[英]Can't change textsize and text color for listview in android
I want to change textsize and textcolor for listview. 我想为listview更改textsize和textcolor。 I do: + I create new xml file (mytext.xml) in folder layout :
我这样做:+我在文件夹布局中创建新的xml文件(mytext.xml):
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:paddingTop="2dip"
android:paddingBottom="3dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
and i change : 我改变了:
adapter = new ArrayAdapter<String> (this,android.R.layout.mytext,HistoryList);
But eclipse can't find mytext.xml? 但是eclipse找不到mytext.xml?
adapter = new ArrayAdapter<String> (this, android.R.layout.mytext, HistoryList);
在上面的行中, ArrayAdapter
的第二个参数应该是R.layout.mytext而不是android.R.layout.mytext 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.