Android Question Is it a bug or my limited understanding of layouts??

Small Petit

Member
Hello, I have two layout files and I loaded them like so:
B4X:
Activity.LoadLayout("Layout")
pnlMainPage.LoadLayout("content")

My main layout is just a panel centered on the screen as shown below:
main.png


And the content layout has the following arrangement:
content.png


Now, when I anchor Button1 to the bottom of the content layout, this is what I get as the end result:
image_2021-11-22_151939.png


And when I anchor it to the top, I rather get the following image as the output:
image_2021-11-22_152112.png


It seems the anchor is doing exactly opposite what I am expecting. Please is this a bug or I still haven't understood the concept of layouts well? Thank you.
 

Small Petit

Member
I thank you all for the comments and suggestions. I am still new to B4X (I think just one week old into B4X programming). I will take my time and download the sample zip files and see what happens. Indeed thank you all for your time.
 
Upvote 0

Small Petit

Member
Moved to the questions forum. It is unlikely a bug.

Please upload the project with the button anchored to the bottom.

Tip: don't waste your time with activities. Switch to B4XPages.
Attached is my project. Thank you.
 

Attachments

  • Layouts.zip
    12.2 KB · Views: 130
Upvote 0

agraham

Expert
Licensed User
Longtime User
Yes but what I wanted to achieve is that the color of the container panel be preserved,
In that case I think you need to programmatically save the Panel colour, load the layout and then reset the colour, though that doesn't seem to achieve anything better than setting it in the layout in the first place - although I guess you might want to reuse the layout with a different background colour.
 
Upvote 0
Top