问题描述
|
我想在我的ListActivity中实现滑动绘制。最初的问题是抽屉在listView后面打开。我已经更改了xml,因此它第二次绘制了抽屉。现在,我可以根据需要使用和查看抽奖,但是看不到任何列表项。
谁能告诉我我要去哪里错了?
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<RelativeLayout
xmlns:android=\"http://schemas.android.com/apk/res/android\"
android:layout_width=\"match_parent\"
android:layout_height=\"match_parent\"
android:orientation=\"vertical\">
<ListView
android:id=\"@android:id/list\"
android:layout_width=\"match_parent\"
android:layout_height=\"match_parent\"
android:background=\"#988767\"
android:divider=\"#00000000\"
android:dividerHeight=\"10dip\"
android:layout_margin=\"10dip\"
android:cacheColorHint=\"#988767\"/>
<SlidingDrawer
android:layout_width=\"fill_parent\"
android:layout_height=\"fill_parent\"
android:id=\"@+id/drawer\"
android:handle=\"@+id/handle\"
android:content=\"@+id/content\"
>
<ImageView
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:id=\"@+id/handle\"
android:src=\"@drawable/arrowup\"
/>
<RelativeLayout
android:background=\"#000000\"
android:layout_width=\"fill_parent\"
android:layout_height=\"fill_parent\"
android:orientation=\"vertical\"
android:id=\"@+id/content\">
<TextView
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:text=\"This is some text\"
android:id=\"@+id/txt\"/>
</RelativeLayout>
</SlidingDrawer>
</RelativeLayout>
解决方法
借助FrameLayout,您可以在列表视图上方显示SlidingDrawer。以下连结
是有关FrameLayout的文章。
, 在滑动抽屉中设置
android:layout_alignParentBottom=\"true\"
android:layout_centerHorizontal=\"true\"