开发者

Listview shows orange background when clicked

开发者 https://www.devze.com 2023-03-01 07:16 出处:网络
I\'m using aListview of Imag开发者_运维问答es (Code is not necesary, it only shows FullScreenImages). The Listview is created dynamycally and I can\'t creat it on xml.

I'm using aListview of Imag开发者_运维问答es (Code is not necesary, it only shows FullScreen Images). The Listview is created dynamycally and I can't creat it on xml.

My problem comes when trying to click on an item. I dont want the orange flashy effect that it shows. Is there any way to evade the effect?


Changing background color of ListView items on Android


lv.setOnItemClickListener(new OnItemClickListener() {

        @SuppressWarnings("deprecation")
        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {


             LinearLayout layout=(LinearLayout) view.findViewById(R.id.listViewLayPerRow);
                layout.setBackgroundColor(Color.YELLOW);




            finish();
        }
    });
0

精彩评论

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

关注公众号