简体   繁体   中英

Can't change textsize and text color for listview in android

I want to change textsize and textcolor for listview. I do: + I create new xml file (mytext.xml) in folder layout :

<?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?

adapter = new ArrayAdapter<String> (this, android.R.layout.mytext, HistoryList);

在上面的行中, ArrayAdapter的第二个参数应该是R.layout.mytext而不是android.R.layout.mytext

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM