B4J Question B4XView - It's not SetLayoutAnimated's fault... so what?

LucaMs

Expert
Licensed User
Longtime User
Playing around... I had a routine that reduced (or increased, ie a zoom) the size of a B4XView.

Perhaps the fact is due to the small size and border of the Label, but this seems like a bug to me: final Width & Height of the B4XView are 10x10 but it looks rectangular.

[In the source code there is the SetLayoutAnimated but also writing the values directly gives the same wrong result]

2.gif



P.S.
ZoomTest (also attached)
2.gif
 

Attachments

  • TestX.zip
    2.4 KB · Views: 256
  • ZoomTest.zip
    9.6 KB · Views: 214
Last edited:

stevel05

Expert
Licensed User
Longtime User
To keep it centered, you would also need to change the font size as it shrinks.
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Ignore that. I didn't look at the project properly. Just set the labels font size to 1 in the designer and it will remain centered.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
To keep it cantered, you would also need to change the font size as it shrinks.
Bravo! I hadn't really thought about it.

Of course it was just to play a bit, the Label wasn't ideal for doing what I wanted.

However, I set the TextSize to a minimum, that is 0.1 and actually the result is different (it becomes a circle, due to the rounded corners).
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
As Salvatore pointed, you are using an absolute value for the radius, so it stays unchanged... but if you set it to be relative to i.e. the views width, then it should remain a rounded square
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Thank you but the problem was only the initial one. Other than that I was just playing around, the corners didn't have to be rounded. I just added that animated gif because it's fun, seeing a square turning into a circle. It's not a problem. Thanks again.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Thank you but the problem was only the initial one. Other than that I was just playing around, the corners didn't have to be rounded. I just added that animated gif because it's fun, seeing a square turning into a circle. It's not a problem. Thanks again.

you also like to play. :D:D:D:D
 
Upvote 0
Top