I've added a couple of simple buttons to a layout and I want to remove the blue shadow/border that apears around the button when I press it. How do I customize the button's apearance on "onpress" action?
Asked
Active
Viewed 449 times
3 Answers
0
there is no way to do this - all "looks" of buttons states are drawables. you can replace them creating own graphics or use Holo generator (deprected, prefering using AppCompat
lib)
HERE you have a Selector
example and also method for coloring button ("shadow" will stay, but will be in your color matching app style)
0
ImageView.setColorFilter(Color.argb(255, 93, 93, 93));
This is gray color, you can set according to your color of image background.

pradip_android
- 283
- 1
- 3
- 16
0
try to set Background drawable for your button as:
btn.setBackgroundResource(R.drawable.yellow_button);
yellow_button.xml :
<!-- pressed -->
<item android:drawable="@drawable/button_1_selected" android:state_pressed="true"/>
<!-- focused -->
<item android:drawable="@drawable/button_1_normal" android:state_focused="true"/>
<!-- default -->
<item android:drawable="@drawable/button_1_normal"/>

Androider
- 3,833
- 2
- 14
- 24