美文网首页Android开发Android知识Android技术知识
Android用ViewPager实现多页面的切换效果

Android用ViewPager实现多页面的切换效果

作者: 程序猿_呆呆 | 来源:发表于2016-11-06 22:06 被阅读556次

说明:


ViewPager用于实现多页面的切换效果,该类存在于Google的兼容包里面,所以在引用时记得在BuilldPath中加入“android-support-v4.jar”

主布局文件

main.xml

```

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical" >

android:id="@+id/viewpager"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center" >

android:id="@+id/pagertitle"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="top" />

```

相关文章

网友评论

    本文标题:Android用ViewPager实现多页面的切换效果

    本文链接:https://www.haomeiwen.com/subject/baenuttx.html