我正在尝试使用android-misc-widgets中介绍的Panel小部件。到目前为止一直很好。现在的问题是滑动面板与我的顶部菜单栏重叠。有关说明,请查看以下屏幕截图。
这是我用拖动手势打开面板的时候(这里没问题):
这是当我单击一下打开面板时(查看与顶部菜单重叠的图标):
还有一个问题,如果活动中有任何内容,打开面板会将该内容推出屏幕!
答案 0 :(得分:0)
我设法用Relative Layout
完成了它。将每个项目放在正确的位置。如果有人遇到同样的问题,这里是xml文件。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="http://schemas.android.com/apk/res/com.ms.rightel.store"
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg" >
>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="@+id/include1"
android:layout_marginTop="3dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="@drawable/categories" />
<com.devsmart.android.ui.HorizontalListView
android:id="@+id/catsHList"
android:layout_width="fill_parent"
android:layout_height="88dp" >
</com.devsmart.android.ui.HorizontalListView>
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="@drawable/latest" />
<com.devsmart.android.ui.HorizontalListView
android:id="@+id/topHList"
android:layout_width="fill_parent"
android:layout_height="88dp" >
</com.devsmart.android.ui.HorizontalListView>
</LinearLayout>
</ScrollView>
<org.miscwidgets.widget.Panel
android:id="@+id/panel1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/include1"
panel:animationDuration="500"
panel:closedHandle="@drawable/top_switcher_collapsed_background"
panel:content="@+id/panelContent"
panel:handle="@+id/panelHandle"
panel:linearFlying="false"
panel:openedHandle="@drawable/top_switcher_expanded_background"
panel:position="top" >
<LinearLayout
android:id="@+id/panelContent"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/android_ldpi" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/android_ldpi" />
</LinearLayout>
<Button
android:id="@+id/panelHandle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
</org.miscwidgets.widget.Panel>
<include
android:id="@+id/include1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
layout="@layout/header" />
</RelativeLayout>
</FrameLayout>