array1とarray2の 2 つの文字列配列があります。
フォントの種類を変更するにはどうすればよいですか?
配列の一部の要素 (たとえば、1 番目と 5 番目の要素) の色を変更するにはどうすればよいですか?
私のフォント タイプは raw/price.ttf にあります。
ListView listView1=(ListView) findViewById(R.id.listView1);
List<Map<String, String>> data = new ArrayList<Map<String, String>>();
for (int i=0; i<array2.length; i++) {
Map<String, String> datum = new HashMap<String, String>(2);
datum.put("title", array1[i]);
datum.put("subtitle", String.valueOf(array2[i]));
data.add(datum);
}
SimpleAdapter adapter3 = new SimpleAdapter(this, data,
android.R.layout.simple_list_item_2,
new String[] {"title", "subtitle"},
new int[] {android.R.id.text1,
android.R.id.text2});
listView1.setAdapter(adapter3);
ここに私のxmlがあります
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scrollingCache="false">
</ListView>