B4J Question B4XView SetColorAndBorder button color over border

MList

Active Member
Licensed User
Hi, this is a B4XPages project, i am writing my first B4J program.
In Designer i created a button, which is a B4XView in pgm.
Then i just set the Color and Border ( in B4A that worked fine)

B4X:
v.SetColorAndBorder(Var.limadarkblue,1dip,xui.Color_White,15dip)

unfortunately in B4j the color of the button is larger then the border, that looks not good.
its the left button, the right button has setColorAndBorder(xui.color.transparent....
With the left button you see the dark blue color below the lower border
See the pic, you must have a very close look

What can i do here ?
Thanks for your help
 

Attachments

  • setBorderColor.jpg
    setBorderColor.jpg
    14.8 KB · Views: 177

Erel

B4X founder
Staff member
Licensed User
Longtime User
In Designer i created a button, which is a B4XView in pgm.
Tip: B4XView is just an API wrapper. The button is a button. It doesn't matter if you set the variable type to B4XView or Button (and you can switch between the two when needed).

I see the issue you describe. I'm not sure why it happens. It happens in the JavaFX layer.
Add a reference to XUI Views and add this:
B4X:
    CSSUtils.SetStyleProperty(Button1, "-fx-background-radius", 18dip)
    CSSUtils.SetStyleProperty(Button1, "-fx-focus-color", "transparent")
It seems to solve it.
 
Upvote 0

MList

Active Member
Licensed User
Hi Erel , thanks for your answer.
With your solution the corners look much better, but there is still a blue line under the lower border...
in Pic i implemented your solution with the Save Button.
 

Attachments

  • setBorderColor.jpg
    setBorderColor.jpg
    19.8 KB · Views: 161
Upvote 0
Top