歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android 應用開發筆記 - 拖動效果(Gallery)

Android 應用開發筆記 - 拖動效果(Gallery)

日期:2017/3/1 10:09:54   编辑:Linux編程

新建一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. </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" />
整體布局效果如下:

Copyright © Linux教程網 All Rights Reserved