textview点击后selector的pressed无效果
生活随笔
收集整理的這篇文章主要介紹了
textview点击后selector的pressed无效果
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原因:
需要配置 ?android:clickable="true"
這個跟開發環境有關,我之前用的android studio 就不需要這一項,默認可以點擊。
**************************
配置textview的按下效果:更換背景和字體顏色
注意:需要寫2個xml的selector文件,否則不會生效。如:
<TextView android:id="@+id/tv_shop_notice"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="點評"android:textSize="10sp"android:clickable="true"android:layout_marginTop="20dp"android:textColor="@drawable/selector_font_grar_to_red"android:background="@drawable/selector_shop_detail_notice_btn"/>?
轉載于:https://www.cnblogs.com/feijian/p/4273027.html
總結
以上是生活随笔為你收集整理的textview点击后selector的pressed无效果的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【专栏必读】王道考研408数据结构万字笔
- 下一篇: 操作系统之进程管理:4、线程与多线程