textview点击后selector的pressed无效果
生活随笔
收集整理的這篇文章主要介紹了
textview点击后selector的pressed无效果
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
原因:
需要配置 ?android:clickable="true"
這個(gè)跟開(kāi)發(fā)環(huán)境有關(guān),我之前用的android studio 就不需要這一項(xiàng),默認(rèn)可以點(diǎn)擊。
**************************
配置textview的按下效果:更換背景和字體顏色
注意:需要寫(xiě)2個(gè)xml的selector文件,否則不會(huì)生效。如:
<TextView android:id="@+id/tv_shop_notice"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="點(diǎn)評(píng)"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"/>?
轉(zhuǎn)載于:https://www.cnblogs.com/feijian/p/4273027.html
總結(jié)
以上是生活随笔為你收集整理的textview点击后selector的pressed无效果的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【专栏必读】王道考研408数据结构万字笔
- 下一篇: 操作系统之进程管理:4、线程与多线程