底部软NavigationBar与我的ListView重叠

Bar*_*ans 14 android listview navigationbar android-listview

我在Nexus 5(Android 5)上运行了我的应用程序,但是我遇到了底部的软NavigationBar与ListView的最后一项重叠的问题.我试图将fitsSystemWindows添加到我的样式和ListView但是没有用.

我的布局的XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:background="@color/sf4l"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ListView android:id="@id/android:list"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:background="@color/sf4l" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

Ken*_*ole 43

将其添加到values-v21目录中的themes.xml:

<item name="android:windowDrawsSystemBarBackgrounds">false</item>
Run Code Online (Sandbox Code Playgroud)

示例(我正在使用AppCompat for actionbars):

<style name="Theme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="homeAsUpIndicator">@drawable/new_indicator</item>
    <item name="android:homeAsUpIndicator">@drawable/new_indicator</item>
    <item name="actionModeBackground">@android:color/black</item>
    <item name="android:windowDrawsSystemBarBackgrounds">false</item>
</style>
Run Code Online (Sandbox Code Playgroud)