点击LinearLayout使用selector改变TextView字体颜色
2013-04-24 14:22
471 查看
<LinearLayout android:clickable="true" android:focusable="true"> <TextView android:duplicateParentState="true"/> android:textColor="@drawable/selector_setting_txt" </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="@color/white"></item> <item android:color="@color/txt_title"></item> </selector>在父控件中添加android:clickable=“true” android:focusable=“true”,而在子控件中添加android:duplicateParentState=“true”子控件就能获得父控件的点击事件
相关文章推荐
- 点击LinearLayout使用selector改变TextView字体颜色 (转)
- 点击LinearLayout使用selector改变TextView字体颜色
- 点击LinearLayout使用selector改变TextView字体颜色
- 点击LinearLayout使用selector改变TextView字体颜色
- 点击LinearLayout使用selector改变TextView字体颜色
- 点击LinearLayout使用selector改变TextView字体颜色
- 点击LinearLayout使用selector改变TextView字体颜色
- 使用Selector改变TextView的字体颜色textColor的方法
- TextView部分字体颜色改变,并且点击进行跳转
- 使用selector修改TextView中字体的颜色
- android使用selector修改TextView中的字体颜色和背景颜色
- TextView后加字体并改变颜色点击跳转
- 使用selector修改TextView中字体的颜色
- Android使用selector修改TextView中字体颜色和背景色的方法
- android中为TextView动态改变字体颜色,如点击时更改
- 使用selector修改TextView中字体的颜色
- 使用selector修改TextView中字体的颜色
- 使用selector修改TextView中字体的颜色
- 使用SpanableString实现textview部分字体点击事件(不同颜色)
- 1.在写TextView 和ImageView 使用Selector切换字体颜色和图片的时候遇到定义的selector无效?