Ich baue eine Android-App mit der Navigationsschublade Vorlage. Ich habe eine Klasse mit dem Namen MainActivity mit einem Layout bekommt, dass meine app_bar_main.xml umfasst, die wie folgt aussieht:App-Leiste deckt Fragment
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.erik.fuelbuddy.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior" >
</FrameLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
fragment_container verwendet werden, um Fragmente anzuzeigen. Hier ist einer von ihnen als Beispiel:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.erik.fuelbuddy.NearbyFragment"
>
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Nearby" />
</FrameLayout>
jedoch die Textview unterhalb der Symbolleiste angezeigt, die durch das Hinzufügen einer Polsterung, um es bestätigt werden können, zum Beispiel 100dp.
Warum ist das und wie kann ich es beheben?