Android Question Can not get labels align in design script

microbox

Active Member
Licensed User
Longtime User
I'm starting to use the design script for my projects, I was able to place panels and imageviews in a 7.7 Tab and 22 inch LCD monitor nicely, but I'm getting nowhere close when trying to add labels to my work. Probably I'm doing it wrong.
ScreenShot.png
Above photo shows in a 22 inch LCD monitor but no issues in my 7.7 inch Tab.
Here is the code I have
B4X:
'All variants script
AutoScaleAll
AutoScaleRate(0.3) ' 0 - 1

Panel1.Width = 35%x 
Panel1.Height = 100%y - 90dip
Panel2.Top = Panel1.Bottom 
Panel2.Width = 100%x - 1dip
Panel2.Height = 100%y - 5dip
Panel3.Top = 0
Panel3.Left = Panel1.Width
Panel3.Width = 100%x - 5dip
Panel3.Height = 100%y - 90dip
'-------------------------------------
ImageView1.Top = 0
ImageView1.Left = 0
ImageView1.Width = 35%x 
ImageView1.Height = 100%y - 90dip
'-------------------------------------
'ImageView2.Top = Panel1.Bottom
ImageView2.Left = 0
ImageView2.Width = 100%x
'-------------------------------------
lblA1.TextSize = 43
lblA1.Top = 0
lblA1.Left = 160dip
lblA2.TextSize = 43
lblA2.Top = lblA1.Bottom
lblA2.Left = 160dip
lblA3.TextSize = 43
lblA3.Top = lblA2.Bottom
lblA3.Left = 160dip
lblA4.TextSize = 43
lblA4.Top = lblA3.Bottom
lblA4.Left = 160dip
lblA5.TextSize = 43
lblA5.Top = lblA4.Bottom
lblA5.Left = 160dip
Hope anyone can help me out on this one.
 

sorex

Expert
Licensed User
Longtime User
you should align the .top with the .top (+extra spacing) of that underlaying image.

OR

give the label a height so that it matches (smaller than what it is now)
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
you should align the .top with the .top (+extra spacing) of that underlaying image.

OR

give the label a height so that it matches (smaller than what it is now)
Hi sorex...I will give a try. Thanks for the time.
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
I'm still having trouble getting the labels display right in both device(22 inch LCD and 7.7inch).:(
I'm using the following script.
B4X:
AutoScaleRate(0.3)
AutoScaleAll
Panel1.Width = 35%x
Panel1.Height = 100%y - 90dip
Panel2.Top = Panel1.Bottom
Panel2.Width = 100%x - 1dip
Panel2.Height = 100%y - 5dip
Panel3.Top = 0
Panel3.Left = Panel1.Width
Panel3.Width = 100%x - 5dip
Panel3.Height = 100%y - 90dip
'-------------------------------------
ImageView1.Top = 0
ImageView1.Left = 0
ImageView1.Width = 35%x
ImageView1.Height = 100%y - 90dip
'-------------------------------------
'ImageView2.Top = Panel1.Bottom
ImageView2.Left = 0
ImageView2.Width = 100%x
'-------------------------------------
' -------------------
'-------------------------------------
lblA1.VerticalCenter = 1
lblA1.Height = 48
lblA1.TextSize = 44
lblA1.Top = -3dip
lblA1.Left = 160dip
lblA2.VerticalCenter = 1
lblA2.Height = 48
lblA2.TextSize = 44
lblA2.Top = lblA1.Bottom
lblA2.Left = 160dip
lblA3.VerticalCenter = 1
lblA3.Height = 48
lblA3.TextSize = 44
lblA3.Top = lblA2.Bottom
lblA3.Left = 160dip
lblA4.VerticalCenter = 1
lblA4.Height = 48
lblA4.TextSize = 44
lblA4.Top = lblA3.Bottom
lblA4.Left = 160dip
lblA5.VerticalCenter = 1
lblA5.Height = 48
lblA5.TextSize = 44
lblA5.Top = lblA4.Bottom
lblA5.Left = 160dip
I tried to adjust the AutoScaleRate. Sorry if this is silly but do I need to make individual variants for each screen size?
 
Upvote 0
Top