おそらく単純ですが、私はこれを理解できません。
高さを正しく処理するためだけにSlidingDrawerのサブクラスがあります。
(解決策を提供してくれた@seydheに感謝します)
問題は、引き出しを開くと、高さが正しく設定されていない
ことです。ハンドルバットから指を離すとすぐに設定されます。
引き出しを引き出し始める前に、SlidingDrawerに高さを設定させるにはどうすればよいですか?
いろいろな組み合わせで試してみましたがslidingDrawerRight.requestLayout();
、うまくいきました。問題はどこでそれを呼ぶことができるかです?
OnClickListener
OnTouchListener
OnDrawerCloseListenerのようなさまざまな場所で試しまし
たが、動作させることができません。たぶん、これを行うためにxmlを修正する方法はありますか?
ツリー画像とxmlを追加します。
下の最愛の写真nr:1に示されているように、
私は引き出しを開け始め、サイズは不規則です:
NR1:開いたときの画像。
NR2: Image when fully opened as soon as i let go of finger.
nr3 SD背景が#eeffaeに設定され、RelativLayout背景が@nullの場合の画像
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/examplegallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
android:id="@+id/btn_newpen_drawtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pen"
/>
<EditText
android:id="@+id/etx_addtext_drawtext"
android:layout_width="fill_parent"
android:layout_toLeftOf="@+id/btn_delete_pen"
android:layout_toRightOf="@+id/btn_newpen_drawtext"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="Enter text here"
/>
<Button
android:id="@+id/btn_delete_pen"
android:layout_toLeftOf="@+id/btn_save_drawtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Del"
/>
<Button
android:id="@+id/btn_save_drawtext"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="save"
/>
</RelativeLayout>
<LinearLayout android:id="@+id/linearLayoutSlidingDrawerRight"
android:layout_width="150dip"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
>
<com.bollen.sppik.editimage.WrappingSlidingDrawer android:id="@+id/slidingDrawerRight"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:handle="@+id/slideHandleButtonRight"
android:content="@+id/contentLayout2"
android:orientation="horizontal">
<ImageButton android:id="@+id/slideHandleButtonRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:onClick="btnSlidingDrawerHandler">
</ImageButton>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/contentLayout2"
android:orientation="vertical"
android:background="#C0C0C0"
>
<ImageButton android:id="@+id/btn_A"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Button_A"
android:background="@android:color/transparent"
android:src="@drawable/right_drawer"
android:onClick="btnAListener">
</ImageButton>
<ImageButton android:id="@+id/btn_B"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@+id/btn_A"
android:text="Button_B"
android:background="@android:color/transparent"
android:src="@drawable/right_drawer"
android:onClick="btnBListener">
</ImageButton>
</RelativeLayout>
</com.bollen.sppik.editimage.WrappingSlidingDrawer>
</LinearLayout>
</RelativeLayout>