0

打电话时我的listview背景没有改变listView.setBackgroundDrawable()

我已经搜索了很多,但没有找到解决方案。

这是代码

ListView v= new ListView(Menu2.this);
v.setBackgroundDrawable(getResources().getDrawable(R.drawable.android));
上下文 c=v.getContext();
setListAdapter(new ArrayAdapter(c, android.R.layout.simple_list_item_1, list));

背景就像我没有调用该方法一样。

谢谢。

4

1 回答 1

0

用这个 :

ListView v= getListView();
v.setBackground(getResources().getDrawable(R.drawable.android));

代替,

ListView v= new ListView(Menu2.this);
v.setBackgroundDrawable(getResources().getDrawable(R.drawable.android));
于 2013-01-20T06:29:00.060 回答