Android Question [Solved] Designer: Anchors Vs Script

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi All,

Please refresh my memory, I should know the answer but have forgotten and can't find it in "search".

In Designer: Chosen Variant. 320 x 480 Scale =1 (160Dip)
Script: AutoScaleRate(1) AutoScaleAll Changing Rate to 0.5 shows no effect.
In the Code: #FullScreen:true #IncludeTitle: false

Example: Panel1 Anchored Top and Bottom Zero offset.
Designer code: Panel1.SetTopAndBottom(0,100%y) [Sorry no Code Tags]

When I run the Script the Designer seems to think the height of Panel1 is 430.

This probably does not matter in the end but if you can clear this up it would be much appreciated.

Regards Roger
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Script: AutoScaleRate(1) AutoScaleAll Changing Rate to 0.5 shows no effect.
You should never touch AutoScaleRate. It will never do anything useful.

The variant size is not important. The screen size is important.

B4X:
Panel1.SetTopAndBottom(0,100%y)
Does the panel fill the screen?

Note that it is easier to do with anchors.
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
Thanks Erel,

Sorry, in trying to provide all info up front and anticipate some questions, I've given the wrong impression.

In real life I don't mess with Autoscale, the anchors alone do produce the correct result on a real device and I've slapped my wrist over the Code Tags.

The question was only in relation to the anomaly seen in the designer between anchors and script, just curious.

Regards Roger
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
Thanks Erel.
Mystery solved.

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