Android Question B4A v13.7 SDK 36 Edge to Edge-Issue using Root.top

Cliff McKibbin

Member
Licensed User
Longtime User
Earlier, I responded to Erel's release of B4A V 13.7 as follows:

The install and compiles of V13.7 all went well.
The Main page displayed correctly. However, all of my other pages display with the fields moved down about 3/4 inch.
Upon inspection, I realized that I did not explicitly set the 'top' of the fields on the 'mainpage'.
On all other pages, I have set the top similar to:

B4X:
private Sub b4xpage_created (root1 As B4XView)
Root=root1
Root.LoadLayout ("TS20")

    btActive.Top=Root.Top +10DIP
    btSort.Top=btActive.top
    imvDetail.Top=btActive.top

In this example, I commented out the btactive.top entry and the page now displays normal.

Is there a way around this issue short of removing the 'top' settings?Y


Erel replied to send more info.
I have built the attached program that shows two columns, one with the top label not positioned from the root and the 2nd column positioned at root.top+10DIP.
You can see how the 2nd column is pushed down. Oddly, the clv is not pushed down.
At any rate, this is an example of the action.
We can get around the issue by not explicitly positioning the top entry using root.top, but it might be important to allow it for some users.

Thanks, Cliff McKibbin
 

Attachments

  • TestRootTop.zip
    9.8 KB · Views: 11

Cliff McKibbin

Member
Licensed User
Longtime User
I was unable to properly build the zip as it is missing the mainpage.bas.

The new version of B4A does not appear to include the command:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
I copied it from an older program but couldn't get it to work.

I have attached the mainpage.bas.
 

Attachments

  • B4XMainPage.bas
    1.5 KB · Views: 8
Upvote 0

mcqueccu

Expert
Licensed User
Longtime User
The new version of B4A does not appear to include the command:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
EXPORT IS THERE, but its now a MACRO. So you have to click on it at the TOP (Where the arrow is pointing)

1786473070029.png
 
Upvote 0

teddybear

Well-Known Member
Licensed User
I have built the attached program that shows two columns, one with the top label not positioned from the root and the 2nd column positioned at root.top+10DIP.
I don't understand why you're changing programmatically the view positions that were already set in the designer.

You can see how the 2nd column is pushed down.
The 2nd column is not pushed down. you changed their positions in the code.

Oddly, the clv is not pushed down.
You didn't do anything to the clv in the code, so its position won't be changed.

We can get around the issue by not explicitly positioning the top entry using root.top, but it might be important to allow it for some users.
How to use root.top correctly is important.
 
Upvote 0

Cliff McKibbin

Member
Licensed User
Longtime User
I have been explicitly locating my views since I started using B4A in 2018 for one reason or another.
It has never been a problem but was surprised by the action of the new release.
I have already reworked several apps to remove the use of 'root.top'.

That being said, I wanted to report on the new action. in case Erel and Company were not aware of it.
I added log entries to the sample program below which show:
label1.top=66
label2.top=281
root.top=253
label1.top and label2.top in the designer are both set to 20.
I might have thought that root.top would be set to 0 to indicate the 'new' working space below the 'heading' section and label1.top and label2.top would be at 20.
With this setup, root.top is in the middle of the working space, explaining why my use of it pushed label2.top down.

I am guessing this is all due to the design change so that most users don't have to change anything related to the vertical spacing and it works good.
If the changes were not done, all users would have probably had to explicitly use my method to locate their top field at root.top+ 250 or so as the root.top would be the top edge and be valued at zero.

Thanks, Cliff
 

Attachments

  • TestRootTop.zip
    13.9 KB · Views: 2
Upvote 0
Top