In LWUIT, a white rectangular background appears when the button is pressed, how to remove it?

StackOverflow https://stackoverflow.com/questions/8702900

  •  12-04-2021
  •  | 
  •  

문제

Using LWUIT, I have a Form (form1) which contains a Button (see the silver arrow at the bottom of the Form in the left image below). This Button is constructed using an image which has a transparent background to give the effect of a non-rectangular Button. When the Button is pressed it shows another Form (form2).

But unfortunately, when the user presses this Button, a white rectangular background appears for a few milliseconds in the background of the image. see the right image below:

Before Pressing the button After Pressing the button

The question is:
How may I prevent this white rectangle from being appeared after pressing the Button ?

도움이 되었습니까?

해결책

You have modified the state of the button when it is selected or unselected. You also have to modify pressed style. You can do it with button.getPressedStyle()

Try:

button.getPressedStyle().setBorder(null);
button.getPressedStyle().setBgTransparency(0);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top