我在使用透明度設置列表背景時遇到問題。我無法設置透明度。ListView透明度
這裏是我的代碼:
<ListView android:id="@+id/players_list" android:layout_width="fill_parent"
android:layout_below="@+id/players_text" android:layout_height="wrap_content"
android:cacheColorHint="#00000000" android:background="#00000000">
</ListView>
在我的活動:
ListView list = (ListView) findViewById(R.id.players_list);
ArrayList<HashMap<String, Object>> mylist = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> map1 = new HashMap<String, Object>();
map1.put("field1", "John Doe");
map1.put("field2", "2342");
mylist.add(map1);
HashMap<String, Object> map2 = new HashMap<String, Object>();
map2.put("field1", "Simina Dorin");
map2.put("field2", "10000");
mylist.add(map2);
SimpleAdapter mSchedule = new SimpleAdapter(this, mylist,
R.layout.online_players_row,
new String[] { "field1", "field2" }, new int[] {
R.id.players_text, R.id.score_text });
list.setAdapter(mSchedule);
有何意見?
發現了問題: 我不得不爲我設置列表的列布局像一個背景:機器人:背景= 「#80439197」
http://stackoverflow.com/questions/1377336/how-to-make-a-listview-transparent-in-android – 2012-01-12 11:34:00
你面臨的問題是什麼?你期待的結果是什麼? – Nitin 2012-01-12 11:34:17
http://community.developer.motorola.com/t5/Android-App-Development-for/ListView-transparent-background/td-p/13650 – Vamsi 2012-01-12 11:42:33