[英]Can't change textsize and text color for listview in android
我想為listview更改textsize和textcolor。 我這樣做:+我在文件夾布局中創建新的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" />
我改變了:
adapter = new ArrayAdapter<String> (this,android.R.layout.mytext,HistoryList);
但是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.