开发者

Change ListView selected colour on Android

开发者 https://www.devze.com 2023-01-27 05:25 出处:网络
So I have a listView on Android which I create in code like so: setListAdapter(new ArrayAdapter<String>(this, R.layout.menuitem, menuitems));

So I have a listView on Android which I create in code like so:

setListAdapter(new ArrayAdapter<String>(this, R.layout.menuitem, menuitems));

ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setBackgroundColor(Color.RED);
lv.setOnItemClickListener(new OnItemClickListener(开发者_如何学编程) { ... });

Is there a way to change the selection colour in code from the default orange colour to another one?


Take a look at: Android ListView Selector Color

0

精彩评论

暂无评论...
验证码 换一张
取 消