iOSLayout

From Xojo Documentation

Revision as of 22:57, 26 March 2021 by Gperlman (talk | contribs) (See Also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Class (inherits from Object)

New in 2020r2

A layout that controls specific Screens depending on the type of device being used.

Properties
Content
Methods
Handle

Notes

You cannot directly add controls to an iOSLayout. You add controls to Screens and Containers.

An iOSLayout allows you to specify how your app looks depending on the type of device being used. For example, on an iPhone you can have your app display a single Screen that contains a Table with a list of items. To do this, in the Navigator, select the iPhoneLayout then in the Inspector, set the Content property to the Screen you wish to be your default. The iPhoneLayout is already set in the App Inspector as the default screen to use for an iPhone.

On an iPad, you may instead want to have a split screen with a list of items on the left and detail information on the right. You can do this by setting the Content property for the iPadLayout to be Split and then setting the Screens for the Main and Detail sections. Refer to iOS Split Screen in the User Guide for more information.

Sample Code

You can have multiple iOSLayouts in your project and switch them at runtime. To do so you use the MobileApplication.CurrentLayout property and change the content like this:

Var s As New MyLayout
App.CurrentScreen.Content = s.Content

Compatibility

iOS project types on iOS and iPadOS operating systems.

See Also

iOSSplitView, iOSTabBar, MobileApplication and MobileScreen classes