如何设置文本颜色在Android的阵列适配器 [英] how to set text color in array adapter in android
本文介绍了如何设置文本颜色在Android的阵列适配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序我创建了一个列表视图,并添加列表中一些文本。在我的编码部分的文本中被添加为阵列适配器具有复选框。在布局我已经给了一个白色的颜色,因为这个列表视图中的文字似乎很平淡。如何设置文本颜色设置为黑色。
in my app i have created a list view and added some text in the list. In my coding part the text are been added as an array adapter to have a check box. In the layout i have given a white color for the list view because of this the text appear to be very dull. How to set the text color to be as black.
我已经把布局文件列表视图中,并放置在编码文本视图中的值。
以下是我的编码部分
i have placed the list view in layout file and placed the values for text view in coding. the following is the part of my coding
names = new String[] { "Sequenced","Random" };
list1 = (ListView) findViewById(R.id.cardlist);
list1.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_checked,names));
list1.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
list1.setItemChecked(0,true);
请帮我......
推荐答案
更改文本颜色在simple_list_item_checked布局
Change the text color in the simple_list_item_checked layout
这篇关于如何设置文本颜色在Android的阵列适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文