Search code examples
androidgridviewcoding-style

How to change the yellow square background when press down on a button in a GridView?


See the yellow background effect by click an icon on your android's main app menu.

Is there any way to change the style, change it to a transparent background or some other styles that looks better?


Solution

  • gridview.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {              
            int c = Color.BLUE;
            gridview.getChildAt(arg2).setBackgroundColor(c);    
        }});