仿TabLayout的选项卡切换,简单易用。
- first,edit your application build.gradle
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
2. second,edit your module build.gradle
```Groovy dependencies { ... compile 'com.github.XinYiWorld:FormValidator:1.0.0' } ```
cztab = (CZTabBar) findViewById(R.id.cztab);
cztab.setBuilder(new CZTabBar.PropertyBuilder()
.cornerRadius(20)
.borderColor(Color.BLACK)
.borderWidth(1)
.txtColor(Color.BLACK)
.txtGravity(Gravity.CENTER)
.widthMode(CZTabBar.WidthMode.EQUAL) //选项卡的宽度策略
.build());
cztab.setOnTabChangedListener(this);
MyOptionBean[] myOptionBeen = {new MyOptionBean(),new MyOptionBean(),new MyOptionBean()};
CZTabBarAdapter<MyOptionBean> adapter = new CZTabBarAdapter<>(this, myOptionBeen);
cztab.setAdapter(adapter);
- QQ邮箱:[email protected]
If you think it's helpful for you,you can reward me to show your encourage.(如果你觉得有用可以对我打赏以示鼓励)