在网上扒了个控件 ImageCycleView 。 也用到项目里面去了。 但是怎么设置小圆点之间的距离,还是不知道。
margin.setMargins(10, 0, 0, 0); 这个鬼代码不顶用啊。 有谁知道的吗?
http://blog.csdn.net/qq_31340657/article/details/51909468
http://blog.csdn.net/qq1377399077/article/details/47003369
http://www.2cto.com/kf/201502/376967.html
http://www.tuicool.com/articles/EBza2y
将 indication_self_margin_percent 的值改大就可以了
/**
* 设置轮播指示器样式,如果你对默认的样式不满意可以自己设置
* @param indicationStyle 资源类型,color,image,shape
* @param unFocus 未获得焦点指示器资源id 图片或shape或color值
* @param focus 获得焦点指示器资源id 图片或shape或color值
* @param indication_self_percent 自身高度的百分比 >=0f
*/
public void setIndicationStyle(IndicationStyle indicationStyle,int unFocus,int focus,float indication_self_percent){
if(indicationStyle== IndicationStyle.COLOR){
unFocusIndicationStyle=drawCircle(50,unFocus);
focusIndicationStyle=drawCircle(50,focus);
}else if(indicationStyle== IndicationStyle.IMAGE){
unFocusIndicationStyle= BitmapFactory.decodeResource(mContext.getResources(),unFocus);
focusIndicationStyle=BitmapFactory.decodeResource(mContext.getResources(), focus);
}
indication_self_margin_percent=indication_self_percent;
initIndication();
}
一般你用第三方控件,别人封装好了,所以你设置margin属性的时候就需要你获取到对应的控件,我也写过轮滑。地址:
https://github.com/dengshiwei/ViewPagerBarnner
小圆点之前设置padding试试