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
分享到:
相关推荐
1.腾讯微博Android客户端开发——OAuth认证学习.pdf 1.腾讯微博Android客户端开发——OAuth认证学习.pdf
NULL 博文链接:https://trylovecatch.iteye.com/blog/1989225
NULL 博文链接:https://trylovecatch.iteye.com/blog/1937036
包括(1运筹学——搜索论.ppt、2运筹学——线性规划.ppt、3运筹学——线性规划2.ppt、4运筹学——线性规划单纯形法.ppt、6运筹学——运输问题.ppt、8运筹学——对偶理论.ppt、9运筹学——对偶单纯形法.ppt、10运筹学...
NULL 博文链接:https://trylovecatch.iteye.com/blog/1998775
12、电力能源行业——数字化转型案例.docx 13、出版传媒行业——数字化转型案例.docx 14、多个行业集锦——数字化转型案例.doc 15、数字化转型方法.doc 1、互联网行业——数字化转型案例.docx 2、金融行业——数字化...
FastReport.Net+V2013.2.5+For+.Net4.0_附安装与破解_个人测试程序 1.首先安装FastReport.Net+V2013.2.5 For Net 4.0 的原始安装文件[FRNetDemo2010.msi] 2.将FastReport.Net+V2013.2.5+For+.Net4.0文件夹中的...
Google Google.Android开发入门与实战第7章.良好的学习开端——Android基本组件介绍之温馨的提醒——Toast和Notification应用.rar
Android经典项目——AndroidStudio版本.zip。 经典项目——AndroidStudio版本.zip经典项目——AndroidStudio版本.zip Android 经典项目 源码
Android中文翻译组——Android中文API合集-4.chm Android中文翻译组——Android中文API合集-5.chm Android中文翻译组——Android中文API合集-6.chm Android中文翻译组——Android中文API_android.widget合集-上.chm ...
安卓app开发项目-实用源码——Android屏幕锁源码(源码).zip安卓app开发项目-实用源码——Android屏幕锁源码(源码).zip安卓app开发项目-实用源码——Android屏幕锁源码(源码).zip安卓app开发项目-实用源码——Android...
SW2010-2013.Activator.SSQ.exe
Android-ViewPagerIndicator 一款仿MIUI的ViewPagerIndicator,支持Tab数量随意定义。 效果图 固定tab数量 非固定tab数量 用法 代码生成tab mIndicator.setVisibleTabCount(4);//设置可见Tab数量 mIndicator....
通讯录 1. 联系人列表显示(姓名,性别,固定电话,手机,邮箱) 2. 联系人列表——操作——修改 3. 联系人列表——操作——删除 ...12. 统计——(分组统计,年龄统计,生日统计) 13. 修改用户密码
Android 4.X 开发完全上手——手把手构建完整Android App范例.
Google.Android开发入门与实战第12章.Android综合案例一——RSS阅读器实例
经典项目——AndroidStudio版本.zip经典项目——AndroidStudio版本.zip
Android源码——Android之Wifi学习教程.zip
安卓Android源码——android打电话源码.zip
深入浅出Android——Android开发经典教材。深入浅出Android——Android开发经典教材.pdf 。深入浅出Android——Android开发经典教材.pdf 。