I had a single layout named "Play" with 4 buttons that I dinamically positioned the fields within it and it seemed visually perfect. Then I decided to use TabHosts and add an extra "About" layout.
Now the original buttons that used to be aligned based on activity.Width seems a little displaced to the right of the screen. Also, a button that used to be anchored to the botton, now is hidden.
What should I consider in terms of screen size when using TabHost?
Regards,
Fernando
Now the original buttons that used to be aligned based on activity.Width seems a little displaced to the right of the screen. Also, a button that used to be anchored to the botton, now is hidden.
What should I consider in terms of screen size when using TabHost?
Regards,
Fernando
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
tbnPages.AddTab("Play","Play")
tbnPages.AddTab("About","About")
tbnPages.Height = Activity.Height
tbnPages.Width = Activity.Width
Dim wGap As Int = (tbnPages.Width - (2 * lblYellow.Width)) / 3
lblYellow.left = wGap
lblYellow.Top = wGap
lblGreen.left = lblYellow.Width + (2 * wGap)
lblGreen.Top = lblYellow.top
lblRed.left = lblYellow.Left
lblRed.Top = lblYellow.height + (2 * wGap)
lblBlue.left = lblGreen.left
lblBlue.Top = lblRed.top
End Sub