Android 組件的抽屜(初級)

Android 組件的抽屜(初級)

本人一開始看到抽屜 效果的時候 本以爲很有難度 結果……結果……..

就這麼一個SlidingDrawer組件 直接拖動到XML就實現了  超汗!!!

code

<SlidingDrawer

android:layout_width="match_parent"

android:id="@+id/slidingDrawer1"

android:layout_height="match_parent"

android:handle="@+id/handle"

android:content="@+id/content"

android:layout_alignParentBottom="true"

android:layout_alignParentLeft="true"

>

<Button

android:layout_width="wrap_content"

android:background="@drawable/gallery_background_1"

android:layout_height="wrap_content"

android:id="@+id/handle"></Button>

<LinearLayout

android:id="@+id/content"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

android:background="#CCFFFF">

<LinearLayout

android:id="@+id/content2"

android:layout_width="match_parent"

android:layout_height="80dp"

android:orientation="horizontal"

>

<ImageButton

android:id="@+id/Simagebutton1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a00"

android:layout_weight="1" 

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

<ImageButton

android:id="@+id/Simagebutton2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a01"

android:layout_weight="1"

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

<ImageButton

android:id="@+id/Simagebutton3"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a02"

android:layout_weight="1"

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

<ImageButton

android:id="@+id/Simagebutton4"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a03"

android:layout_weight="1"

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

</LinearLayout>

<Button

android:id="@+id/Sbutton1"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="1111111"

android:layout_marginTop="15dp"

></Button>

<Button

android:id="@+id/Sbutton2"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="222222"

></Button>

<Button

android:id="@+id/Sbutton3"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="333333"

></Button>

<Button

android:id="@+id/Sbutton4"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="13424順序各點6"

></Button>

</LinearLayout>

</SlidingDrawer>

佈局可以按自己想要實現的效果來佈局 這個效果我做的很醜 只當做例子把  讓美工做些好看的圖片來修飾它吧

效果

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章