1

最初はGONEに設定されている画面の幅の約半分のRelativeLayout1があります..そして、screenWidthを取得する必要がある別のレイアウトRelativeLayout2がそれに設定されています..私に合わせて、RelativeLayout1 VISIBLEを設定し、RelativeLayout2を左に移動するように設定する必要がありますRelativeALyout2 を左側の画面幅に絞り込まないでください。

    <RelativeLayout
    android:id="@+id/fullScreen"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent" >

    <RelativeLayout
        android:id="@+id/menulayout"
        android:layout_width="200dp"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true" >

        <RelativeLayout
            android:id="@+id/topMenubar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:background="@drawable/slider_header"
            android:fitsSystemWindows="true" >

            <TextView
                android:id="@+id/menu"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:text="@string/menu"
                android:textColor="#787878" >
            </TextView>
        </RelativeLayout>

        <ListView
            android:id="@+id/menulist"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_below="@id/topMenubar"
            android:background="#232323"
            android:cacheColorHint="#00000000"
            android:divider="#5b5b5b"
            android:dividerHeight="1dp"
            android:scrollbars="none" />

        <Button
            android:id="@+id/backmenu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:background="@drawable/arrowleft" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/maingridlayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_toLeftOf="@id/menulayout" >

        <RelativeLayout
            android:id="@+id/topBar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:background="@drawable/header_bg"
            android:fitsSystemWindows="true" >

            <ImageView
                android:id="@+id/handle"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:src="@drawable/handle" />

            <TextView
                android:id="@+id/notificationnumber"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:background="@drawable/redbatch"
                android:gravity="center"
                android:textColor="#ffffff"
                android:textSize="20dp"
                android:visibility="gone" />

            <ImageView
                android:id="@+id/searchnow"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:src="@drawable/searchunsel" />

            <RelativeLayout
                android:id="@+id/logolayout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:layout_toLeftOf="@id/handle"
                android:layout_toRightOf="@id/searchnow" >

                <com.drona.custom.ImageThumbLayout
                    android:id="@+id/logo"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true" >
                </com.drona.custom.ImageThumbLayout>
            </RelativeLayout>
        </RelativeLayout>

4

2 に答える 2

0

android:layout_width="fill_parent"

あなたはこれを変更しようとすることができます

于 2012-12-04T09:31:31.370 に答える
0

私がやったことをわかりました..私は、menyLayoutが表示され、スクロール可能なfalseでHorizo​​ntallScrollViewを取りました...次に、それを表示する必要があるときは、使用してビューをスクロールします

scrollTo(int x,iny y);

または、私ができることは、mainGridLayoutの上にmenuLayoutを追加します。つまり、mainGridLAyoutの親に別の子を追加します

于 2012-12-04T09:44:09.727 に答える