Android Question Is it possible more than one "Layout" in the same B4XPage class module?

Sergio Castellari

Active Member
Licensed User
Hello there,
Currently I use a B4XPage class code where I load a single "layout".
Can you have several "layouts" on the same page?
Any code examples?
Greetings
 

LucaMs

Expert
Licensed User
Longtime User
I don't know what you want to achieve, exactly.

You can load more than one layout into Root; all views will be displayed.

If you want to see one layout at a time, when needed, use Root.RemoveAllViews and load a different layout.

An alternative can be to create a basic layout, which contains for example 3 maximized panels, anchored on all edges, load this layout in Root, then load a layout in each of the 3 panels and use the BringToFront method of the panel you want to see; or set the visibility of the panel to be displayed to True and to False the other two.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Hello there,
Currently I use a B4XPage class code where I load a single "layout".
Can you have several "layouts" on the same page?
Any code examples?
Greetings
see sample:

Panels with layout

 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Nice (now I have to "study" how to add the B4A (and B4i) project to yours, which is B4J only, as it were a "full B4XPages project"; maybe I'll have to develop a tool that does this or open a "Wish" ) but @Sergio Castellari asked if you can load more than one layout on a single B4XPage - I think he knows that he can create more than one page.


P.S.
(now I have to "study" how to add the B4A (and B4i) project to yours, which is B4J only, as it were a "full B4XPages project"; maybe I'll have to develop a tool that does this or open a "Wish" )
I did it manually; it was not so easy!
A tool should analyze the original project well; not easy but it can be done.
 
Last edited:
Upvote 0

Sergio Castellari

Active Member
Licensed User
Hi @LucaMs !!!
You understood very well!
In fact with your explanation I learned how new "layouts" could be loaded
But trying to load a new "layout" I found that it could not have the same view names because they conflict with "Subs" that had existing code.
So for now I gave up and am going to use a new B4XPage.
I am going to continue reading the links that they suggested to me to better understand how it works.

Thanks!
Greetings
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…