首先要说的是,界面滑动,就需要多个view来进行切换,实际上可以用一个ArrayList<View> pageViews来保存这些view的信息,然后进行切换
LayoutInflater inflater = getLayoutInflater();
pageViews = new ArrayList<View>();
pageViews.add(inflater.inflate(R.layout.item01, null));
pageViews.add(inflater.inflate(R.layout.item02, null));
pageViews.add(inflater.inflate(R.layout.item03, null));
然后定义每一个item01,item02,item03的xml文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="fil

本文介绍如何在Android中实现全屏界面的左右滑动切换效果,通过使用ArrayList<View>存储多个视图,并自定义GuidPageChangeListener监听器和GuidPageAdapter适配器来实现页面间的平滑切换。

4648

被折叠的 条评论
为什么被折叠?



