现在的位置: 首页 > 综合 > 正文

Android界面滑动

2013年11月25日 ⁄ 综合 ⁄ 共 916字 ⁄ 字号 评论关闭

最基本的滑动:ViewFlipper 中包含多个View ,View之间的切换。

配置文件layout_viewflipper.xml

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="vertical"  
  4.     android:layout_width="fill_parent"  
  5.     android:layout_height="fill_parent"  
  6.     >  
  7. <ViewFlipper   
  8.     android:layout_height="wrap_content"  
  9.     android:layout_width="match_parent"  
  10.     android:id="@+id/viewFipper01">  
  11.     <include android:id="@+id/layout1" layout="@layout/layout_view1"/>  
  12.     <include android:id="@+id/layout2" layout="@layout/layout_view2"/>  
  13. </ViewFlipper>  
  14. </LinearLayout>  

对应的layout_view1.xml和layout_view2.xml

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout  
  3.   xmlns:android="http://schemas.android.com/apk/res/android"  
  4.   android:orientation="vertical"  
  5.   android:layout_width="match_parent"  
  6.   android:layout_height

抱歉!评论已关闭.