Android 应用开发笔记 - 拖动效果(Gallery)


新建一View,清单如下:

view_gallery.xml

  1. <LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"  
  2.     xmlns:tools="http://schemas.android.com/tools"  
  3.     android:orientation="vertical"  
  4.     android:layout_width="fill_parent"  
  5.     android:layout_height="fill_parent" >  
  6.       
  7. </LinearLayout>  
在面板拖拽图标,然后更改相关属性(Properties),如下:
  1. <Gallery  
  2.         android:id="@+id/gallery02"  
  3.         android:layout_width="fill_parent"  
  4.         android:layout_height="wrap_content"   
  5.         android:layout_marginTop="30dp"/>  

添加一按钮,如下:

  1. <Button  
  2.         android:id="@+id/btnReturn"  
  3.         android:layout_width="wrap_content"  
  4.         android:layout_height="wrap_content"  
  5.         android:layout_marginTop="166dp"  
  6.         android:text="@string/btn1Caption" />  
整体布局效果如下:

  • 1
  • 2
  • 下一页

相关内容