Android Question Autoscale etc...

skipsy

Member
Licensed User
Longtime User
Hi all,

I have spent time searching in this forum and still doens not understand the way AutoScale works (in Designer).
I understood this command allows to scale my views based on the device physical size.
See attached 2 tests.

First test : A small panel including a button.
Image1.jpg

The running script gives this :
Image2.jpg

(supposed to fill the screen ! ??)

For the second test, the same bigger panel
Image3.jpg

With the script, the panel goes over the screen:
Image4.jpg


What did I missunderstood ??

Thanks
WW
(B4A 3.0)
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
I am not very familiar with AutoScale but there are good information about in Klaus Beginners Guide.
And if you need to let your panel fill the entire screen, you could, perhaps, better use the anchors
 
Upvote 0

skipsy

Member
Licensed User
Longtime User
I was considering the 'anchor way' with script commands like
B4X:
Panel1.Width = 100%x
but I can't find the way to
anchor views... I guess it is not possible with my B4A 3.0 (?)
 
Upvote 0

skipsy

Member
Licensed User
Longtime User
I have downloaded the latest trial version.
Autoscaleall still does not work.
B4X:
Panel1.Width = 100%x
still works fine but anchored button (to rigth/bottom) does not move with
the panel :eek::eek::eek:
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
Remove the AutoScaleRate(1) from the designer scripts. This is causing the UI to be stretched. A "normal" AutoScaleRate is 0.3 and is automatically defined
 
Upvote 0

skipsy

Member
Licensed User
Longtime User
I have tried every values from 0.1 to 1... the panel is just bigger and bigger.
When it perfectly match for one device, it does'nt for a bigger or smaller one.
I must change the value of AutoScale()... For each device size !
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
First, I'm still not sure what the issue is that you're trying to solve. How is it that you want the panel to appear? What exactly are you trying to scale, the button?

Also we need to see your code and designer scripts values
 
Upvote 0

skipsy

Member
Licensed User
Longtime User
Hi,
There is no really code, I am doing tests with the designer.
I am posting a new thread trying to explain another way ;)
 
Upvote 0
Top