带有圆圈和标题指示符的Viewpager [英] Viewpager with circle and title indicator

查看:153
本文介绍了带有圆圈和标题指示符的Viewpager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Viewpager和 JakeWharton 的圈子和标题"视图寻呼机 带有圆圈指示器的viewpager可以正常工作,但是同时使用带有圆圈和标题指示器的viewpager时,两个指示器都无法工作. 这是该问题的屏幕截图:

I'm using Viewpager and the Circle and Title view pager from JakeWharton The viewpager with the circle indicator is working fine, but while using the view pager with both circle and title indicator both indicators are not working. Here is a screenshow of the issue:

因此可以同时使用两个指标,如果可以的话,我该怎么做?还有谁知道我该如何为标题指示器设置样式?现在,它显示一条蓝线,没有任何文字.

So is it possible to use both indicators at the same time, and if so how can I do that? Also does anyone knows how can I style the title indicator? Right now it shows a blue line and no text..

这是我的代码:

adapter = new ContractsPagerAdapter(getActivity(), topContracts, selected);     
        pager.setAdapter(adapter);
        indicator.setViewPager(pager);
        titleIndicator.setTextColor(getResources().getColor(R.color.white));
        titleIndicator.setViewPager(pager);

推荐答案

您可以在逻辑上做到这一点.我已经使用ViewPager和框架布局实现了它. 框架布局以显示指标.指示灯基本上是两个图像,用于打开和关闭.您可以下载完整的代码并进行相应的更改. http://javaant.com/viewpager-with-circle-indicator -in-android/#.VpdtjMB943g 希望这会帮助你.

Hi you can do it logically. I have implemented it using ViewPager and frame layout. Frame layout to show the indictor. Indicator is basically two image for off and on. You can download the complete code and change accordingly. http://javaant.com/viewpager-with-circle-indicator-in-android/#.VpdtjMB943g Hope this will help you.

这篇关于带有圆圈和标题指示符的Viewpager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆