Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个自定义按钮字段,当按钮处于焦点时默认蓝色背景即将到来,我想删除那个蓝色背景。实际上我将图像放在按钮上,并且图像上有某些区域是透明的。当该自定义按钮处于焦点时,会显示蓝色背景。我想删除那个蓝色背景。
非常感谢
覆盖方法
protected void drawFocus(Graphics graphics, boolean on) { if (on) { //draw your own custom focus. } }
public void onFocus(int direction) {}
并且不要在其中调用 super.onFocus