Such statements doesn't encourage me to help you however I will do it this time.Designer drives me mad with transparent panels
Thank you Erel. First I apologize for the title of the posting: It was the result of dealing with Layouts for HOURS to understand the idea layers work and not coming to a solution.Such statements doesn't encourage me to help you however I will do it this time.
Run the designer script in the designer
It happens because it is inside Panel2 and 50%y is relative to the activity in this case.
I recommend you to make the layout simpler and not nested like this.
That's the mistake. %x and %y in the designer script are relative to the size of the panel or activity that loads the layout. Note that in the code %x and %y are always relative to the activity size.50%y of panel2t
It seems that I am totally blocked or we do not understand each other:That's the mistake. %x and %y in the designer script are relative to the size of the panel or activity that loads the layout.
You can easily see that your panel disappears by click on the "run" button in the designer. Try it.
It seems that he wants his Panel2t (your Panel3) inside Panel2 (Panel2 is the Panel2t's parent).It appears that you are over complicating things @Pflichtfeld.
It works if you set it so:Actually, I too don't understand why his layout (L0) doesn't work as expected.
But I explained it...Actually, I too don't understand why his layout (L0) doesn't work as expected.
Panel2t.SetTopAndBottom(0, Panel2.Height)
Thank you, Peter!Why exactly do you believe that you need 2 layouts?
So I thought it to be a good idea, put the particular views in particular layouts and load in each activity the main-layout and then into a panel of layout main the particular layout.
Yes I did. But I do not want to loose the space on the screen, the tab-headers need, because I have to pack together so much view-stuff (drawings, pictures...) for some of the activities.Hmm, have you thought about using TabView (Tabs)???
I think he wanted Panet2t height 50%y of Panel2 (already set to 50% of its parent by script) at bottom of Panel2.Because the reference of the top coordinate of Panel2t is Panel2!!
You set the Top property to 50% which is the height of Panel2, therefore you won't see it because you moved ot of the size of Panel2!!!
You should set Panel2t to:
Panel2t.SetTopAndBottom(0%y, 50%y)
%x and %y in the designer script are relative to the size of the panel or activity that loads the layout
Because the reference of the top coordinate of Panel2t is Panel2!!
In that case it should be:think he wanted Panet2t height 50%y of Panel2 (already set to 50% of its parent by script) at bottom of Panel2.
Panel2t.SetTopAndBottom( Panel2.Height / 2, Panel2.Height)
That is weird, but I understand it, thank you again!You need to do a single change to fix the layout.
Change:
Panel2t.SetTopAndBottom(50%y,100%y)
To:
B4X:Panel2t.SetTopAndBottom(0, Panel2.Height)
As far, as I understood, this is:25%x means a quarter of the activity width. Not the parent.
There is one exception. %x / %y in the designer script are relative to the main parent which is the view that loads the layout.
Panel2t.LoadLayout("L2")
That's true.in Activity_create is executed, then x% and y% are relative to the view, the layout is loaded in.
No, he put Panel2t onto Panel2 because of the transparency!I think he wanted Panet2t height 50%y of Panel2 (already set to 50% of its parent by script) at bottom of Panel2.