一个比较好的自定义View,继承自LinearLayout,可使用于Activity与Fragment之间
https://github.com/shallcheek/CaterpillarIndicator
建议:
直接把src
下的java
类拷贝过来即可
XML使用
<com.chaek.android.widget.CaterpillarIndicator
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
app:slide_item_width="30dp"
app:slide_caterpillar="true"
app:slide_footer_color="#fc9001"
app:slide_text_size_normal="17sp"
app:slide_text_size_selected="18sp"
app:slide_footer_line_height="3dp"
app:slide_padding_bottom="4dp"
app:slide_text_center_flag="textCenter"
app:slide_round="true" />
地址:
https://github.com/shallcheek/CaterpillarIndicator