【发布时间】:2012-01-12 11:29:46
【问题描述】:
我在设置具有透明度的列表背景时遇到问题。我无法设置透明度。
这是我的代码:
<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);
有什么建议吗?
发现问题: 我必须将列表的行布局设置为以下背景:android:background="#80439197"
【问题讨论】:
-
您面临的问题是什么?你期待的结果是什么?
标签: android listview background transparency