2013.12.05(4)——— android ViewPagerIndicator之SampleLinesDefault
package com.viewpagerindicator.sample;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.LinePageIndicator;
public class SampleLinesDefault extends BaseSampleActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_lines);
mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
mIndicator = (LinePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mPager);
}
}
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<com.viewpagerindicator.LinePageIndicator
android:id="@+id/indicator"
android:padding="5dip"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
</LinearLayout>
1、注意layout里面的是
com.viewpagerindicator.LinePageIndicator
2、修改line的样式
xml
app:strokeWidth="4dp"
app:lineWidth="30dp"
app:unselectedColor="#FF888888"
app:selectedColor="#FF880000"
java
final float density = getResources().getDisplayMetrics().density;
indicator.setSelectedColor(0x88FF0000);
indicator.setUnselectedColor(0xFF888888);
indicator.setStrokeWidth(4 * density);
indicator.setLineWidth(30 * density);
SelectedColor:选中的颜色
UnSelectedColor:默认的颜色
StrokeWidth:线的粗细
LineWidth:线的宽度
- 大小: 89.3 KB
分享到:
相关推荐
基于因子分析的我国A股上市...争力评价——以医药企业为例_张澳.caj
文件说明: 1,安装说明.txt ——————————安装手册 2,jdk-170.tar.gz ————...4,check_java.sh———————————版本核对 注意:使用命令接口切换时,需要将自己配置的环境变量注释或者删掉!!!
嵌入式成品项目——无线接收时钟.zip嵌入式成品项目——无线接收时钟.zip嵌入式成品项目——无线接收时钟.zip嵌入式成品项目——无线接收时钟.zip嵌入式成品项目——无线接收时钟.zip嵌入式成品项目——无线接收时钟...
05 java面试——杭州-蚂蚁金服-Java高级.pdf 06 java面试——杭州-蚂蚁金服-资深工程师.pdf 07 java面试——南京-软通动力-Java中级.pdf 08 java面试——厦门-中软国际-Java中级.pdf 09 java面试——上海-拼多多-...
python项目——Word助手.zip python项目——Word助手.zip python项目——Word助手.zip python项目——Word助手.zip python项目——Word助手.zip python项目——Word助手.zip python项目——Word助手.zip python项目...
C语言项目——MP3音乐播放器.zip C语言项目——MP3音乐播放器.zip C语言项目——MP3音乐播放器.zip C语言项目——MP3音乐播放器.zip C语言项目——MP3音乐播放器.zip C语言项目——MP3音乐播放器.zip C语言项目——...
python项目——RCQ读者书库.zip python项目——RCQ读者书库.zip python项目——RCQ读者书库.zip python项目——RCQ读者书库.zip python项目——RCQ读者书库.zip python项目——RCQ读者书库.zip python项目——RCQ...
微信小程序——用户反馈组件(截图+源码).zip 微信小程序——用户反馈组件(截图+源码).zip 微信小程序——用户反馈组件(截图+源码).zip 微信小程序——用户反馈组件(截图+源码).zip 微信小程序——用户反馈...
微信小程序——移动端商城(截图+源码).zip 微信小程序——移动端商城(截图+源码).zip 微信小程序——移动端商城(截图+源码).zip 微信小程序——移动端商城(截图+源码).zip 微信小程序——移动端商城(截图+...
4. 长——短 5. 甜——苦 6. 慢——快 7. 黑——白 8. 近——远 9. 前——后 10. 冷淡——热情 11. 黑暗——光明 12. 南——北 13. 低——高 14. 闲——忙 15. 开——关 16. 哭——笑 17. 臭——香 18. 丑——美 19....
Android中文翻译组——Android中文API合集(4).chm
———————————————— 版权声明:本文为CSDN博主「MechMaster」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:...
IBExpert 2013.2.20 单文件和谐版,谁用谁知道。
发福利了,Aspose Total for NET 2013.09.10 最新破解,danny_su 大作,花了10个贡献分才下载的了!现免费提供大家:) This package contains the following .NET Components: - Aspose.BarCode for .NET v5.7.0.0 ...
"安卓Android源码——android仪表盘.zip" 这个标题明确指出,我们即将探讨的是与安卓(Android)操作系统相关的源代码,特别是关于“仪表盘”部分。在Android系统中,仪表盘通常指的是用户界面中的控件或者应用,...
微信小程序——面包旅行:界面设计,文本展示(截图+源码).zip 微信小程序——面包旅行:界面设计,文本展示(截图+源码).zip 微信小程序——面包旅行:界面设计,文本展示(截图+源码).zip 微信小程序——面包...
微信小程序——小游戏-别踩白块(截图+源码).zip 微信小程序——小游戏-别踩白块(截图+源码).zip 微信小程序——小游戏-别踩白块(截图+源码).zip 微信小程序——小游戏-别踩白块(截图+源码).zip 微信小程序...
java毕业设计——基于ssm的仿微博系统设计与实现(源码+数据库).zip java毕业设计——基于ssm的仿微博系统设计与实现(源码+数据库).zip java毕业设计——基于ssm的仿微博系统设计与实现(源码+数据库).zip java毕业...
4. 撅屁股看飞机 ———— 有眼无珠!这句歇后语讽刺那些眼光短浅或辨别能力差的人。 5. 走路摸屁股 ———— 小心过肚(度)!形容过度谨慎的行为。 6. 李世民捏窝头 ———— 御驾亲蒸(征)!这句歇后语用谐音来...
基于IntraWeb的数据表格的多选实现 既可以单条操作,也可以多选操作。 delphi源代码。 BS开发Web网站开发,不需要安装服务器,Apache和IIS都不需要,自带企业级服务器。...————————————————