It seems I got confused due to a posting of Erel where he writes:Panel2, is a child of Panel1 and covers the bottom half part of the screen.
You set Panel2.SetTopAndBottom(50%y, 100%y), which is OK.
Panel2t, is a child of Panel2 with the same size. And you set it with:
Panel2t.SetTopAndBottom(50%y, 100%y), which is wrong !!!
Because the reference of the top coordinate of Panel2t is Panel2!!
From the different answers here I assume this must be wrong. % is always refering to the parent view. Even in designer.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.
It seems, that my device does not work in this manner: Even a transparent L2 does delete the view, it is loaded in, if this view is not set to transparent. I could solve this issue here with Erels help.Then why did you need to add a transparent panel Panel2t on top of Panel2 with the same dimensions? Without Panel2t, when you load L2, which has a transparent background it set the background of Panel2 to transparent. You set Panel2t to transparent, but the transparency of Panel2t at the end doesn't come from the background you set, but from the background of layout l2. Set the background of Panel2t to any non transparent value and it works the same.
I considered that, but the code I use is huge, and I thought it would be clearer, if I spread it to different activities.I would work with one Activity and Panels and show or hide the Panels depending on the different cases.
That is right. It was the only way i got it to work.No, he put Panel2t onto Panel2 because of the transparency!
At least, that is how I understood it, because he wrote somewhere that he had to add a transparent Panel to get his layout to work.
because I assumed y% would refer to the activity, even in nested views...The problem started in the first layout. Panel2t was out of the screen.
No.From the different answers here I assume this must be wrong. % is always refering to the parent view. Even in designer.
Is the code for the common layout the same in all Activities?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.
Panel2t.SetTopAndBottom(0,Panel2.Height)
Panel2t.SetTopAndBottom(0%y,50%y)
This particular code is not much but yes, I will do thatIs the code for the common layout the same in all Activities?
I think you might consider Classes.
You must be more accurate. SetTopAndBottom doesn't refer to anything.setTopAndBottom actually refers to the activity (as you allways sayed). Lets say: a size is produced, using activity-measures. But then this size is transferred into panel2.(and that all happens in designer). This is the only way all that makes sense for me.
As I showed you here: could be hard..You should never ever use %x and %y to set the size or position of nested views.