如何解决使用选择器文件摆脱橙色焦点按钮组?
| 我从platform / android-7 / data / res / drawable-mdpi下的android sdk中获取了btn_default.xml文件,并将其卡在应用程序的drawable目录中。 然后,我获取了XML文件中引用的所有9补丁图像,并将它们也复制到了我的drawable目录中。 接下来,我修改了每个9补丁图像,其中有橙色,因此它是红色的(用于测试)并保存了。 当我运行我的应用程序,并用小键盘聚焦一个按钮,或者只是触摸一个按钮时,我仍然在按钮周围得到橙色的亮绿色。那个橙色的hilite来自哪里? 这是我的选择器文件:<?xml version=\"1.0\" encoding=\"utf-8\"?>
<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">
<item
android:state_window_focused=\"false\"
android:state_enabled=\"true\"
android:drawable=\"@drawable/btn_default_normal\" />
<item
android:state_window_focused=\"false\"
android:state_enabled=\"false\"
android:drawable=\"@drawable/btn_default_normal_disable\" />
<item
android:state_pressed=\"true\"
android:drawable=\"@drawable/btn_default_pressed\" />
<item
android:state_focused=\"true\"
android:state_enabled=\"true\"
android:drawable=\"@drawable/btn_default_selected\" />
<item
android:state_enabled=\"true\"
android:drawable=\"@drawable/btn_default_normal\" />
<item
android:state_focused=\"true\"
android:drawable=\"@drawable/btn_default_normal_disable_focused\" />
<item
android:drawable=\"@drawable/btn_default_normal_disable\" />
</selector>
解决方法
好吧,经过大量的挖掘,我找到了下面的答案。似乎无法通过选择器文件设置选择器颜色(btn_square_overlay_pressed.png)。我必须在我的gridview对象上设置setSelector(),该对象是从ImageAdapter填充其内容的,而ImageAdapter是从xml选择器文件获取其图像的。
如何在ExpandableListView中更改褪色的橙色?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。