安卓选择器 selector 的笔记
16lz
2021-01-24
Drawable 选择器 Android
<?xml version="1.0" encoding="utf-8"?> -
-
Color 选择器 Android
<?xml version="1.0" encoding="utf-8"?>
此篇文章对选择器状态进行了讲解。
去掉 RadioButton 默认的选择器 参考:
XML 布局中 android:button="@null"
Java 代码 radioButton.setButtonDrawable(new StateListDrawable());
Kotlin 代码 radioButton { buttonDrawable = StateListDrawable() }
代码设置 TextView TabHost 的 Color Selector:
Java 代码 textView.setTextColor(AppCompatResources.getColorStateList(context, R.color.selector));
Kotlin 代码 radioButton { setTextColor(AppCompatResources.getColorStateList(ctx, R.color.selector)) }
更多相关文章
- color 颜色代码 android res/values/colors.xml
- Android之判断当前指定App是否在前台
- TimerTask抛不出运行时异常
- Android(安卓)TabHost的使用(一)
- Android(安卓)在 Fragment 中集成 React-Native(RN)步骤
- RecycleView 单选 以及多选单选互斥两种状态 和多选
- Android(安卓)DEX反编译后部分代码解析
- android ButterKnife 解决重复findViewById
- 自定义Dialog UI