PageIndicatorView底部点显示

本文介绍了如何在Android项目中使用PageIndicatorView库来实现底部导航点的显示,通过添加.aar文件减少项目的方法数,并且指出PageIndicatorView的最小API级别为14,需要依赖support library。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、依赖包:
compile 'com.romandanylyk:pageindicatorview:X.X.X'

If your project already use appcompat-v7 support library, you can omit PageIndicatorView dependencies by adding a single .aar file to your project, that will decrease total amount of methods used in your project.

compile 'com.romandanylyk:pageindicatorview:X.X.X@aar'

Keep in mind, that PageIndicatorView has min API level 14 and these dependencies:

 compile 'com.android.support:support-annotations:25.3.0'
 compile 'com.android.support:support-compat:25.3.0'
 compile 'com.android.support:support-core-ui:25.3.0'
2、代码中

ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
viewPager.setAdapter(adapter);
//instance of android.support.v4.view.PagerAdapter adapter

PageIndicatorView pageIndicatorView = (PageIndicatorView) view.findViewById(R.id.pageIndicatorView);
pageIndicatorView.setViewPager(viewPager);
3、布局中
 <com.rd.PageIndicatorView
        android:id="@+id/pageIndicatorView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        attrs:piv_viewPager="@+id/viewPager"/>


NameSupport versionPreview
AnimationType.NONE0.0.1anim_none
AnimationType.COLOR0.0.1anim_color
AnimationType.SCALE0.0.1anim_scale
AnimationType.SLIDE0.0.1anim_slide
AnimationType.WORM0.0.1anim_worm
AnimationType.FILL0.0.6anim_worm
AnimationType.THIN_WORM0.0.7anim_thin_worm
AnimationType.DROP0.1.0anim_drop
AnimationType.SWAP0.1.1


anim_swap

github地址:https://github.com/romandanylyk/PageIndicatorView

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值