获取Listview默认点击的颜色,具体取决于设备 [英] 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到一个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));
所以没有问题我设置drawable为正常使用时的透明和点击时橙色。
So no problem I set the drawable to transparent when normal use and orange when clicked.
我唯一的问题是在星系S和其他一些自定义手机(Sense UI)中,列表视图的颜色是蓝色或绿色!
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!
我在哪里可以得到这种颜色?
Where can I get this color??? That woule be really helpfull!
推荐答案
刚才找到答案:
android:background="@android:drawable/list_selector_background"
这篇关于获取Listview默认点击的颜色,具体取决于设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!