【发布时间】:2014-06-05 12:07:36
【问题描述】:
我正在使用自定义列表视图在我的应用程序中显示数据,然后我尝试添加导航抽屉
点击抽屉布局不起作用。它最终打开了自定义列表视图,因为它位于抽屉列表视图的后面。抽屉列表视图永远不会获得焦点,即使抽屉打开了
以下是我的主要活动 xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<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" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:focusable="true"/>
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:focusableInTouchMode="true"
android:focusable="true"
android:descendantFocusability="blocksDescendants"/>
</android.support.v4.widget.DrawerLayout>
<ListView
android:id="@+id/listScreen"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:dividerHeight="7dp">
</ListView>
</RelativeLayout>
【问题讨论】:
-
请检查 Spirit 的回答是否已接受,有什么问题?
标签: android navigation drawer