In the designer I have created a standard 320 x 480 layout with a panel (60dip in height, 320dip in width) which holds 5 buttons each 60 x 60 dip. I have placed the leftmost button 2dip from the left, the buttons have a 4dip space between them and the rightmost button 2dip from the right. This gives a total width of 320dip. In the designer script I have the following in the All Variants section.
AutoScaleAll
pnlbuttons.Bottom = 100%y
When I send this to the UI cloud it does not appear correctly on any of the devices, it's almost right on the Samsung I9000 (480x762 scale 1.5) but the rightmost button extends slightly beyond the right edge of the screen. If I add
pnlbuttons.SetLeftAndRight(0,100%x)
at the bottom it seems to make no difference. After much trial and error with different scale rates and various other changes the only way I could get the layout to display properly on all screens was to omit the autoscale and manually setup each button using %x as follows:
btnwidth = 18%x
btnheight = 18%x
pnlbuttons.width = 100%x
pnlbuttons.Height = btnheight
btn1.Left = 1%x
btn1.Width = btnwidth
btn1.Height = btnheight
btn2.Width = btnwidth
btn2.Height = btnheight
btn2.Left = btn1.Right + 2%x
btn3.Width = btnwidth
btn3.Height = btnheight
btn3.Left = btn2.Right + 2%x
btn4.width = btnwidth
btn4.Height = btnheight
btn4.Left = btn3.Right + 2%x
btn5.Width = btnwidth
btn5.Height = btnheight
btn5.left = btn4.Right + 2%x
pnlbuttons.Bottom = 100%y
This gives an acceptable result but spacing for the rightmost button is a bit off.
So why does AutoScaleAll not produce a correctly scaled panel on the devices and should I just use the %x approach which is much more tedious?
Ta.