在Android 4.4半透明狀態欄,在列表視圖NavigationDrawer重疊動作條略有下降。它可以在我測試過的所有其他API級別上正常工作。NavigationDrawer保證金使用與ActionBarCompat和NavigationDrawer半透明狀態欄選項時
據我所知,這是因爲marginTop
選項從屏幕的頂部開始,而不是從操作欄的頂部(狀態欄的底部)開始。 狀態欄底部。有一個偏移
是否有解決方法嗎?我正在使用示例佈局,並將marginTop
設置爲?attr/actionBarSize
。
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- android:layout_gravity="start" tells DrawerLayout to treat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
The drawer is given a fixed width in dp and extends the full height of
the container. A solid background is used for contrast
with the content view. -->
<ListView
android:id="@+id/drawer_list"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="@drawable/bg_app" />
</android.support.v4.widget.DrawerLayout>
你找到任何解決方案? – kalehv