Frame
<frame>
is a UI component used to display <page>
elements. Every app needs at least a single <frame>
element, usually set as the root element.
See also:
A frame with a default page
import * as React from "react";
function AppContainer(){
return (
<frame>
<page>
<actionBar title="Default Page Title" />
<gridLayout>
<label text="Default Page Content" />
</gridLayout>
</page>
</frame>
);
}
A frame with a default page from an external component
import * as React from "react";
import HomePage from './HomePage';
<frame>
<HomePage />
</frame>
Multiple Frames
If you need to create multiple frames, you can do so by wrapping them in a Layout, for example if you want to have 2 frames side-by-side:
import * as React from "react";
<gridLayout columns={"* *"} rows={[]}>
<frame col={0}/>
<frame col={1}/>
</gridLayout>
Native component
Android | iOS |
---|---|
org.nativescript.widgets.ContentLayout | UINavigationController |