When loading a first page with AutoScaleRate(1) and AutoScaleAll, then a second page, when we show
the first page, it's like the Autoscale had no effect, controls are super big.
in this example
layout1 :
AutoScaleAll
layout2 :
AutoScaleRate(1)
AutoScaleAll
B4X:
Private Sub Application_Start (Nav As NavigationController)
Dim nc As NavigationController
nc.Initialize("nc")
' in Sub Process_Globals
' Public NavControl As NavigationController
NavControl = nc
page1.Initialize("page1")
page1.RootPanel.LoadLayout("layout1")
page2.Initialize("HomePage")
page2.RootPanel.Color = Colors.White
page2.RootPanel.LoadLayout("layout2")
page2.RootPanel.Color = Colors.Black
NavControl.ShowPage(HomeScreen)
What exactly do you want to do ?
You have layout1 with one layout variant 1024 * 768 AutoScaleRate(1) and AutoScaleAll.
Then layout2 with two layout variants 1024 * 768 and 568 * 320 and only AutoScaleAll which means AutoScaleRate(0.3) the defalt value.
Then you add a view in code.
You should define the dimensions of the view, added in the code, in the Page_Resize routine only ther 100%x and 100%y are known.
What exactly do you want to do ?
You have layout1 with one layout variant 1024 * 768 AutoScaleRate(1) and AutoScaleAll.
Then layout2 with two layout variants 1024 * 768 and 568 * 320 and only AutoScaleAll which means AutoScaleRate(0.3) the defalt value.
Then you add a view in code.
You should define the dimensions of the view, added in the code, in the Page_Resize routine only ther 100%x and 100%y are known.
Downscaling form an iPad layout to an iPhone layout seems not to work very well.
The main problem is the different width/height ratio.
Attached you have modified version with layout3 for an iPhone with AutoscaleRate(0.5) and anchors.
Doesn't look too bad.