//有一个bug待解决,点击选中或者点击view有时候会把修改恢复之前的样式,有解决方案的还请大家给出参考,目前这样也算好很多了
public class ChargeNumberPicker extends NumberPicker {
public ChargeNumberPicker(Context context) {
super(context);
}
public ChargeNumberPicker(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ChargeNumberPicker(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public void addView(View child) {
super.addView(child);
updateView(child);
}
@Override
public void addView(View child, int index,
android.view.ViewGroup.LayoutParams params) {
super.addView(child, index, params);
updateView(child);
}
@Override
public void addView(View child, android.view.ViewGroup.LayoutParams params) {
super.addView(child, params);
updateView(child);
NumberPicker修改选中的字体样式
于 2022-03-11 13:48:12 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)