Circle page indicator - how to change fill color changing

前端 未结 4 1963
自闭症患者
自闭症患者 2021-02-05 11:39

I\'m using ViewPageIndicator, specifically CirclePageIndictor in my Android application. The requirement is that the fillColor will mo

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 12:19

    final CirclePageIndicator circleIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
        circleIndicator.setViewPager(_pager);
        final float density = getResources().getDisplayMetrics().density;
        circleIndicator.setFillColor(0xFFFFFFFF);
        circleIndicator.setStrokeColor(0xFFFFFFFF);
        circleIndicator.setStrokeWidth(1);
        circleIndicator.setRadius(6 * density);
    

提交回复
热议问题