0

我正在尝试利用android-misc-widgets中引入的 Panel 小部件。到目前为止一切都很好。现在的问题是滑动面板与我的顶部菜单栏重叠。为了清楚起见,请查看以下屏幕截图。

这是当我使用拖动手势打开面板时(这里没问题): 在此处输入图像描述

这是当我单击打开面板时(查看与顶部菜单重叠的图标): 在此处输入图像描述

还有一个问题,如果 Activity 中有任何内容,打开面板会将这些内容推出屏幕!
在此处输入图像描述

4

1 回答 1

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>
于 2012-06-12T11:15:05.880 回答