私は下から上の構造を持つSlidingDrawerを使用しようとしています。私はスライド式の引き出しの内容の中に4つのスピナーを配置しました..そして、私が実行すると、ハンドル(私は画像があります)画面。私はここでXMLを使ってSlidingDrawerの高さを設定する方法は?
が私のxmlレイアウト...
main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<SlidingDrawer
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/drawer"
android:handle="@+id/MyHandle"
android:content="@+id/MyContent">
<LinearLayout
android:id="@+id/MyHandle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="vertical">
<ImageView
android:id="@+id/SlideIcon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/images"/>
</LinearLayout>
<FrameLayout
android:id="@+id/MyContent"
android:layout_width="fill_parent"
android:layout_height="200dip"
android:orientation="vertical">
<include
android:id="@+id/DrawerContent"
layout="@layout/spinnerlayout"
android:layout_height="wrap_content"/>
</FrameLayout>
</SlidingDrawer>
</FrameLayout>
とspinnerlayout.xmlである(つまり、わずか4つのスピナ上記...)それは単にコンテンツの上に処理したいです...
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:foregroundGravity="bottom"
android:layout_gravity="bottom"
android:background="@color/grey">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner_first"/>
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner_second"/>
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner_third"/>
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner_fourth"/>
</LinearLayout>
</FrameLayout>
そして、私の質問をより明確にするために、私はスクリーンショットを持っている...
私はそれがスピナー真上そのハンドル(矢印)を持つようにしたい。..
はそれを配置することは可能ですか?
私はそれを愛する知っている、onMeasureをオーバーライドから()私は...それを設定することができ、多くの例もあります。しかし、私は高さを設定することが可能かどうかを知るためにこの質問をしていました..あなたは何ですか、それは可能ですか? –
use android:topOffset = "" –
これはもう一つのサンプルです。http://android-journey.blogspot.com/2009/12/android-viewflipper-and-slidingdrawer.html –