Android TextView 禁用颜色更改
我有一个带有以下 XML 的 TextView (它是视图中唯一的东西):
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ipg_display"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="textview"
android:scrollbars = "vertical"
android:fillViewport = "true" android:clickable="false"/>
我遇到的问题是,当用户单击文本视图(拖动它或其他什么)时,文本颜色会稍微改变,如下所示如果视图被“单击”。我如何禁用此功能?
我希望将“clickable”设置为 false 可以解决问题,但没有运气:(
我错过了什么?
I have a TextView with the following XML (it's the only thing in the view):
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ipg_display"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="textview"
android:scrollbars = "vertical"
android:fillViewport = "true" android:clickable="false"/>
The problem I'm having is that when the text view is clicked by the user (to drag through it or whatever), the text changes color slightly as if the view is being "clicked". How do I disable this?
I was hoping that settings "clickable" to false would solve the issue, but no luck :(
What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用以下选择器作为按钮的背景。并确保每件物品都有相同的颜色。
HTH。
use the following selector for your button as the background. and make sure every item has the same color.
HTH.