1

こんにちは、みんな、

カスタム SurfaceView で SlidingDrawer を使用していて、問題が発生しました。問題は、SlidingDrawer のハンドルが上下にドラッグされているときに、SurfaceView が残りのビュー領域を認識しないことです。

ハンドルの現在の高さに基づいて SurfaceView の高さのベースを設定する方法はありますか?

レイアウト XML:

<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

    <and.dev.test.CustomSurfaceView android:id="@+id/flock"
        android:layout_width="fill_parent" android:layout_height="fill_parent" />

<SlidingDrawer android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:id="@+id/drawer"
    android:handle="@+id/handle" android:content="@+id/content"
    android:layout_gravity="fill">

    <LinearLayout android:id="@id/handle"
        android:orientation="horizontal" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:gravity="center_horizontal"
        android:background="#FFFFFFFF">

        <TextView android:background="@drawable/bird_blue"
            android:layout_width="wrap_content" android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout android:id="@id/content"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="wrap_content">


    </LinearLayout>
</SlidingDrawer> </FrameLayout>
4

1 に答える 1

0

SlidingDrawerレイアウト上のオーバーレイとしてのみ使用できます。FrameLayoutこれは、 aまたは a内にのみ配置できることを意味しますRelativeLayout

カスタムSurfaceViewSlidingDrawerFrameLayoutXML に入れるだけで問題なく、高さのサイズ変更などについて心配する必要はありません。

それが役立つことを願っています

于 2011-06-05T23:38:03.927 に答える