B4J Question B4XPages and Designer - resizing question

Hilton

Active Member
Licensed User
Longtime User
I am using B4J v8.50beta as an exercise to learn about b4xpages. To do that I am converting work done in a non-pages app.

After having constructed a page in the Designer and then loading the layout (ie Root.Loadlayout("xxxxx")), the resizing works as desired. Because I do not want too many panes in the Designer page, I have constructed another page in the designer that contains a panel which in turn contains a xCustomListview.

I then do the Root.Loadlayout("yyyy"), which loads the layout fine and all looks good, and it is, until you resize the form. I have found that only the last layout loaded "yyyy" will resize and that the original "xxxx" loaded no longer resizes.

I tried with simple layouts using 3 empty (2 in one layout and 1 in another) panes using the anchors only to find that the above pattern holds true.

Is this meant to be? I am aware that my limited understanding may be the problem.

Any suggestions,
Hilton.
 

Hilton

Active Member
Licensed User
Longtime User
Attached is the requested set of files.

1. the mainpage layout contains an header and footer plus a few buttons
2. there are two layouts loaded ("MainPage" and "mp2")
3. mp2 is the red pane in the middle
4. when i compile it and then resize the page, only the mp2 pane will resize and everything else will not.
5. if i comment out the root.loadlayout("mp2"), compile and then resize, all will resize.

Thanks,
Hilton
 

Attachments

  • testpages.zip
    240 KB · Views: 293
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Tip: click on the "check anchors" button. You will see that the anchors of the three buttons are wrong.

The behavior you describe is indeed how resizing works. It is not related to B4XPages. Only the last layout loaded to a pane(l) will be resized automatically.

You should either merge the two layout files or add a panel to the first layout and then load the second layout to that panel. Layouts can be nested like this and they will be resized.
 
Upvote 0

Hilton

Active Member
Licensed User
Longtime User
Thank you Erel for the added insight. I did as you suggested and clicked the "check anchors" and realised that I had taken no notice of the change in colour, I was too preoccupied with my lack of understanding. I have done as you suggested and it works as you say. Back to the drawing board.

Bye for now,
Hilton
 
Upvote 0
Top