0
我正在嘗試在這個問題中提出@lnamdar問(Drawer layout with fixed menu item)。我試圖對他們的解決方案做出更好的解釋。DrawerLayout上的底部項目
我想這一點:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<!-- The main content view -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/transparent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/black"
android:text="This is the footer text"/>
</RelativeLayout>
<!-- The navigation drawer -->
<ListView
android:id="@+id/left_drawer"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:background="@android:color/black"/>
但是,這是導致列表視圖不顯示,當我切換打開/關閉,我看到的是腳註中的唯一的事情。 我試圖把listView和footer textView都放在RelativeLayout中,但是它隨着Drawer Layout類上使用的佈局參數的ClassCastException而崩潰。
感謝您的幫助!
謝謝尼古拉,同時我得到了相同的結論,並能夠做到這一點。真的很感謝幫助! – cperes