Android Question Panel content is not resized when I resize panel.

RobertoS

Member
Licensed User
Longtime User
Hello,
I have a problem with a very basic operation in B4A
I have an activity with two full screen panels that contains some controls.
The panel are anchored top/bottom/left/right but the second one is moved away in the designer so I can view both panels when I'm designing them.
As soon as the activity is started I move both the panels to 0,0 and resize them to be full screen.

The problem is that the content of the second panel does not resize correctly

I am attaching a small sample project that shows the problem, just click on "Panel2" and you will see that the label width is not correct.

I'm sure I am doing something wrong but I don't know how to solve this simple problem.

In this screen the "PANEL2" label should be almost full width
 

Attachments

  • test-panels.zip
    7.9 KB · Views: 331
  • panel.jpg
    panel.jpg
    15 KB · Views: 520

Erel

B4X founder
Staff member
Licensed User
Longtime User
The panel are anchored top/bottom/left/right but the second one is moved away in the designer so I can view both panels when I'm designing them.
Use two layout files instead or relocate the panel in the designer script code.

The anchors and designer script are only applied when the layout is loaded (note that this is different than in B4J and B4i).
 
Upvote 0

RobertoS

Member
Licensed User
Longtime User
Hello Erel,
I tried to move panel2 in the designer script using
B4X:
Panel2.Left=0
Panel2.Top = 0
but it still does not work, the panel is moved but the size of the label in it is not correct (this time is wider than the screen)
It does not work also If I set also the panel width to 100%x in the designer script.
 
Upvote 0

RobertoS

Member
Licensed User
Longtime User
Ok, I tried to use different layouts but I cannot do it in my app because I fill the views with values and if I switch layout I will lose all the old values.
I have to change approach...
 
Upvote 0
Top