新建一View,清单如下:view_gallery.xml
- <LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- </LinearLayout>
在面板拖拽图标,然后更改相关属性(Properties),如下:
- <Gallery
- android:id="@+id/gallery02"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="30dp"/>
添加一按钮,如下:
- <Button
- android:id="@+id/btnReturn"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="166dp"
- android:text="@string/btn1Caption" />
整体布局效果如下: