1、具体步骤
说下大概实现步骤,一般我们有两种,一种是viewpager+作为游标的点 。另外一种是重写viewpager。
效果图:
1.1 布局,直接viewpager+一个viewgroup就好。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.maxence.viewpager.MainActivity" > <RelativeLayout android:layout_width="match_parent" android:layout_height="220dp" > <android.support.v4.view.ViewPager android:id="@+id/vp_pager" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- 作为viewgroup 动态 add 游标 --> <LinearLayout android:id="@+id/ll_container" android:layout_width="match_parent" android:layout_height="30dp" android:gravity="center" android:orientation="horizontal" android:layout_alignParentBottom="true" ></LinearLayout> </RelativeLayout> </RelativeLayout>
网页标题:Android使用viewpager实现自动无限轮播图-创新互联
文章网址:https://www.cdcxhl.com/article28/eohjp.html
成都网站建设公司_创新互联,为您提供云服务器、网站维护、营销型网站建设、定制网站、网站改版、微信公众号
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联