iOS Question Layout does not appear same as designer

CrownDeveloper

Member
Licensed User
Hi, Am i doing something wrong. I design a layout on designer using tab (768 x 1024) which appears perfect on designer but when I load the layout in app it doesn't show the page same as designer (see attached Appimage and designerImage). it goes out of bounds of the device. my code to load layout is below.
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page

    Private Button1 As Button
    Private Panel1 As Panel
End Sub

Private Sub Application_Start (Nav As NavigationController)
    'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.LoadLayout("1")  ' 1 is the name of layout
   
    NavControl.ShowPage(Page1)
End Sub
 

Attachments

  • designerImage.jpg
    designerImage.jpg
    72.7 KB · Views: 122
  • AppImage.jpg
    AppImage.jpg
    73.8 KB · Views: 113

CrownDeveloper

Member
Licensed User
I was confused because layout was shown properly on tab without adding variant, but what i needed was to add a tab variant to work properly in compiled app.
Thanks for tip.
 
Upvote 0
Top