Android Question Filling the panel with a label after rotation?

Jerryk

Active Member
Licensed User
Longtime User
In the example I have a Panel and two Labels, the second one is rotated by -90 degrees. I want to programmatically fill the Panel with these labels. The first Label is filled correctly, the second one is filled incorrectly.
B4X:
Private Sub Button4_Click
    Label1.Top = 0
    Label1.Left = 0
    Label1.Width = Panel2.Width
    Label1.Height = Panel2.Height
   
    Label2.As(B4XView).Rotation = -90
    Label2.Top = 0
    Label2.Left = 0
    Label2.Width = Panel2.Height
    Label2.Height = Panel2.Width
End Sub
picture after
Label2.Top = 0
Label2.Left = 0
Screenshot_2025.02.09_21.53.04.141.png

Any solutios?
 
Solution
B4X:
Label2.Visible = False
Label2.Width = Panel2.Height
Label2.Height = Panel2.Width
Label2.Left = (Panel2.Width - Label2.Width) / 2
Label2.Top = (Panel2.Height - Label2.Height) / 2
Label2.Rotation = -90
Label2.Visible = True

LucaMs

Expert
Licensed User
Longtime User
B4X:
Label2.Visible = False
Label2.Width = Panel2.Height
Label2.Height = Panel2.Width
Label2.Left = (Panel2.Width - Label2.Width) / 2
Label2.Top = (Panel2.Height - Label2.Height) / 2
Label2.Rotation = -90
Label2.Visible = True
 
Upvote 0
Solution
Top