forked from hongyangAndroid/Android-ProgressBarWidthNumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.bak
93 lines (74 loc) · 2.84 KB
/
README.md.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Android-ViewPagerIndicator
一款仿MIUI的ViewPagerIndicator,支持Tab数量随意定义。
# 效果图
## HorizontalProgressBarWithNumber
![Sample Screenshots][1]
## RoundProgressBarWidthNumber
![Sample Screenshots][2]
# 用法
## 代码生成tab
mIndicator.setVisibleTabCount(4);//设置可见Tab数量
mIndicator.setTabItemTitles(mDatas);//设置tab标题
mViewPager.setAdapter(mAdapter);
mIndicator.setViewPager(mViewPager,0);//绑定ViewPager
## 直接布局中书写
布局中编写,则代码中只需要绑定ViewPager一行代码。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:zhy="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffffff"
android:orientation="vertical" >
<com.zhy.view.ViewPagerIndicator
android:id="@+id/id_indicator"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@drawable/title_bar_bg_one_row"
android:orientation="horizontal"
zhy:visible_tab_count="3" >
<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="短信1"
android:textColor="#CCFFFFFF"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="收藏2"
android:textColor="#CCFFFFFF"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="推荐3"
android:textColor="#CCFFFFFF"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="推荐4"
android:textColor="#CCFFFFFF"
android:textSize="16sp" />
</com.zhy.view.ViewPagerIndicator>
<android.support.v4.view.ViewPager
android:id="@+id/id_vp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
</android.support.v4.view.ViewPager>
</LinearLayout>
#关于我
[我的博客地址][3]
[1]: https://github.com/hongyangAndroid/Android-ViewPagerIndicator/blob/master/fixed_item.gif
[2]: https://github.com/hongyangAndroid/Android-ViewPagerIndicator/blob/master/more_items.gif
[3]: http://blog.csdn.net/lmj623565791