V2.30
I had initially used Designer to lay out views, it worked, but I decided to script the sizes and positions. It also worked (almost). Shown below...
I spent some time trying to fathom why my script required a correcting factor as shown above, of -10, to sit the Panel on the top of the Label. While all the information seemed correct, the problem was caused by the original design (non script) showed the height of the Panel as 60, whereas it was now required to be 70.
I cannot believe that when a script is added the original figures do not update or alternatively get ignored. Otherwise we have to edit in two places??
Especially as the Tutorial says that the initial design does not need to be accurate.
Also if I add... pnlControl.Width = 100%x - tbnStart.Width - tbnInterim.Width ...then on a wider device the pnlControl does not stretch the width between the two buttons as it does with or without this line on the original 320 x 480 scale = 1 device.
Leaving the above line in and then removing that marked [1] solves it but leaving [1] in and removing [2] does not.
Please enlighten me.
I had initially used Designer to lay out views, it worked, but I decided to script the sizes and positions. It also worked (almost). Shown below...
B4X:
'All variants script
'AutoScaleAll 'uncomment to scale all views based on the device physical size.
lblStatus.Left = 0dip
lblStatus.Bottom = 100%y
lblStatus.Width = 100%x
lblStatus.Height = 40dip
tbnStart.Left = 0%x
tbnStart.Width = 70dip
tbnStart.Height = 70dip
tbnStart.Bottom = lblStatus.Top
tbnInterim.Right = 100%x
tbnInterim.Width = 70dip
tbnInterim.Height = 70dip
tbnInterim.Bottom = lblStatus.Top
pnlControl.Bottom = lblStatus.Top -10
pnlControl.Left = tbnStart.Right '[2]
pnlControl.Right = tbnInterim.Left '[1]
'pnlControl.Width = 100%x - tbnStart.Width - tbnInterim.Width
pnlControl.Height = 70dip
I spent some time trying to fathom why my script required a correcting factor as shown above, of -10, to sit the Panel on the top of the Label. While all the information seemed correct, the problem was caused by the original design (non script) showed the height of the Panel as 60, whereas it was now required to be 70.
I cannot believe that when a script is added the original figures do not update or alternatively get ignored. Otherwise we have to edit in two places??
Especially as the Tutorial says that the initial design does not need to be accurate.
Also if I add... pnlControl.Width = 100%x - tbnStart.Width - tbnInterim.Width ...then on a wider device the pnlControl does not stretch the width between the two buttons as it does with or without this line on the original 320 x 480 scale = 1 device.
Leaving the above line in and then removing that marked [1] solves it but leaving [1] in and removing [2] does not.
Please enlighten me.
Last edited: