removing the default blue color on focus

∥☆過路亽.° 提交于 2020-01-15 06:33:11

问题


I have a created a custom Button field , when the button is on focus default blue background is coming , i want to remove that blue background . actually i am placing image on button and on image there are certain area which is transparent . when that custom button is on focus then blue background is displayed . i want to remove that blue background.

Thanks alot


回答1:


Override method

protected void drawFocus(Graphics graphics, boolean on) {
        if (on) {
                 //draw your own custom focus.
                }
            }



回答2:


override method

public void onFocus(int direction) {}

and don't invoke super.onFocus in it



来源:https://stackoverflow.com/questions/2816937/removing-the-default-blue-color-on-focus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!