获取列表视图点击默认的颜色,这取决于设备 [英] Getting the Listview default clicked color, depending on the Device
问题描述
在我的Android应用程序,我用一个ListView有的就至极的用户可以点击线性布局。
In my android application, I use a listview and some linear layout on wich the user can click.
当然,我有我的LinearLayout的背景设定在pssed规定的$ P $,选择,定义了XML文件:
Of course, I had to set the background of my LinearLayout to a xml file where the stated pressed, selected are defined:
myView.setBackgroundDrawable(
getDrawable(android.R.drawable.list_selector_background));
因此,没有问题,我设置可绘制为透明的,当点击时正常使用和橙色。
So no problem I set the drawable to transparent when normal use and orange when clicked.
我唯一的问题是,GALAXY S和其他一些定制的手机(Sense界面)的列表视图中单击的颜色为蓝色或绿色的!
My only problem is that on the galaxy S and some other customized phone (Sense UI) the color of the listview clicked is blue or green!
所以,我需要选择这种颜色将其设置为我的LinearLayout的背景。 我不想混橙色和蓝色或橙色和绿色为我的用户!
So I need to pick this color to set it to the background of my linearlayout. I don't want to mix orange and blue, or orange and green for my user!
我在哪里可以得到这个颜色??? 这woule可以真正的帮助!
Where can I get this color??? That woule be really helpfull!
推荐答案
刚刚找到了答案:
android:background="@android:drawable/list_selector_background"
这篇关于获取列表视图点击默认的颜色,这取决于设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!