【发布时间】:2014-03-07 09:32:37
【问题描述】:
我的问题很简单。我可以在 DrawerLayout 的内容菜单中使用 HorizontalScrollView 吗? 我的 DrawerLayout 看起来像这样:
<android.support.v4.widget.DrawerLayout
android:id="@+id/pnlMenu"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- Main content view -->
<ListView
android:id="@+id/lst"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:fastScrollEnabled="true"
android:focusable="true"
android:focusableInTouchMode="true"
tools:listitem="@layout/item_layout" >
</ListView>
<!-- Content of menu -->
<FrameLayout
android:id="@+id/drawerFrame"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:clickable="true"
android:background="@color/black" >
<fragment
android:id="@+id/frag"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.test.TestFragment" />
</FrameLayout>
</android.support.v4.widget.DrawerLayout>
在片段内部,我有 HorizontalScrollView,但是当我尝试触摸它时没有任何反应,因为抽屉布局跟随我的手指。 我认为禁用内容菜单中的触摸事件并仅在单击主要内容视图时使 DrawerLayout 可关闭将解决我的问题。真的吗?如果没有,谁能告诉我该怎么办?
谢谢。
【问题讨论】:
标签: android touch-event drawerlayout