Ich habe eine Navigationsschublade, die mehrere Elemente enthält. Ich habe eine Schaltfläche am unteren Rand der Navigationsleiste hinzugefügt. Das Problem ist, dass in kleinen Bildschirmen die Schaltfläche das letzte Element in der Schublade abdeckt.Wie füge ich etwas Platz unter dem letzten Gegenstand in einer Navigationsschublade hinzu?
Wie kann ich etwas Platz unter dem letzten Element hinzufügen, so dass die Schaltfläche nichts abdecken wird?
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" >
<Button
android:id="@+id/remove_ads_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/red"
android:text="@string/remove_ads"
android:textColor="@color/white"
android:textSize="15sp" />
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
activity_main_drawer.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="none">
<item
android:id="@+id/action_contact_us"
android:icon="@drawable/ic_contact_us"
android:title="@string/action_contact_us" />
<item
android:id="@+id/action_share"
android:icon="@drawable/ic_share_24dp"
android:title="@string/action_share" />
<item
android:id="@+id/action_rate_us"
android:icon="@drawable/ic_rate_us_24dp"
android:title="@string/action_rate_us" />
<item
android:id="@+id/action_follow_us"
android:icon="@drawable/ic_follow_us_24dp"
android:title="@string/action_follow_us" />
<item
android:id="@+id/action_help"
android:icon="@drawable/ic_help_name"
android:title="@string/action_help" />
<item
android:id="@+id/action_about_us"
android:icon="@drawable/ic_info_24dp"
android:title="@string/action_about_us" />
<item
android:id="@+id/action_settings"
android:icon="@drawable/ic_settings_24dp"
android:title="@string/action_settings" />
</group>
</menu>
Siehe http://stackoverflow.com/questions/30543605/how-to-add-footer-to-navigationview-android-support-design-library. – CoolMind