【发布时间】:2015-04-03 11:31:21
【问题描述】:
我的幻灯片菜单完美无缺,但是当我想滚动幻灯片菜单时却无法滚动。我在列表视图中有足够的项目可以滚动。如何在 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">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!-- Framelayout to display Fragments -->
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</ScrollView>
<!-- Listview to display slider menu -->
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@color/list_divider"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector"
android:background="@color/list_background"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/btn_pick"
android:layout_width="90dp"
android:layout_height="55dp"
android:layout_alignParentBottom="true"
android:text="pick" />
<Button
android:id="@+id/sticker"
android:layout_width="90dp"
android:layout_height="55dp"
android:text="add sticker"
android:layout_below="@+id/paint_view"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:id="@+id/save"
android:layout_width="90dp"
android:layout_height="55dp"
android:text="save"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<in.wptrafficanalyzer.graphicspickimageviewcanvas.PaintView
android:id="@+id/paint_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/btn_pick" />
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
-
首先从布局中删除滚动视图,其次你走错了轨道找到抽屉布局的例子先了解然后尝试你自己
-
这里滚动视图的目的是什么?
-
滚动视图内的列表视图?
-
移除滚动视图,列表视图具有滚动功能。
标签: android scrollview android-scrollview drawerlayout