In the designer select the layout and it will be a copy of the original when you first add it as a new variant. Then in the Designer scripts you can specify all the positions and sized for the views.
The way you could do it in your program is to add something like this in the Sub Activity_Create.
If FirstTime then
'assuming the layout is a copy of the first variant
Dim v As View
Dim aspx As float = 1366/1280
Dim aspy As Float = 768/800
For i = 0 Activity.NumberOfViews - 1
v = Activity.GetView(i)
v.height = v.height * aspy
v.left = v.left * aspx
v.top = v.top * aspy
I'm a newbie with 1 weeks experiance so any advice I give can be safely ignored. There are probably better answers to come but thinking about other people's problems might help me learn.
In the ScaleModule you have different options.
You can stretch
- like %x and %y.
- strech like AutoScale from the Designer.
- stretch according x and y scales.
- you can define a reference screen, not only the 'standard' screen size.
You might have a look at chapter 8.11.3 AutoScale more advanced examples in the Beginner's Guide.
Yes, and many solutions.
There is no magic function nor library to fit a given layout to every screen.
It depends also on the kind of application, what do you want to display on the screen at the same time on a small or big screen.