Adding Views to Your Multi-Device Project

From RAD Studio
Jump to: navigation, search

Go Up to Using FireMonkey Views


A view is a version of the Master view that is customized for a given device or a type of device, for example Windows Desktop.

  • To toggle between views in the Form Designer, select a view on the drop-down Views menu.
  • To add one or more views to your multi-device project, click a platform in the Available list. The view you added is immediately used for your project in the Form Designer, and the view's name appears under a new group, Created, separated from the Available views:

ViewsDropDownMenu.png

When you add a view, a new form is included in the project and is saved in the project folder with the following name structure:

<unit name><platform>

The list of views appears in the code as follows:

Delphi:

The names of new view forms are listed in the Implementation section:

implementation

{$R *.fmx}
{$R *.Windows.fmx MSWINDOWS}
{$R *.iPhone4in.fmx IOS}
{$R *.LgXhdpiPh.fmx ANDROID}

C++:

The names of new view forms are listed in the <Unit_name>.cpp:

#pragma resource "*.fmx"
#pragma resource ("*.Windows.fmx", MSWINDOWS)
#pragma resource ("*.iPhone4in.fmx", IOS)
#pragma resource ("*.NmXhdpiPh.fmx", ANDROID)

To learn how to add customized views that are not listed in the Available section, see Adding a Customized View to the View Selector.

MultipleViews.png

See Also