This is an overview of the most common usage of Frame. For more information about the available properties, methods, or events, head over to the complete API documentation for Frame.
<Frame>は<Page>エレメントを表示するためのUIコンポーネントです。全てのアプリは少なくとも1つの<Frame>エレメントが必要で、通常であればルートエレメントとして設定されます。
もしnativescriptのバージョン3.xからアプリを統合してその挙動を保存したいなら、エントリーファイルに以下のスニペットを追加すれば、ルートのFrameを生成してデフォルトページを描写することができます。
new Vue({
render: h => h('Frame', [ h(HomePageComponent) ])
})複数のフレームを生成する場合、レイアウトでラップすることで可能になります。例えば2つのフレームを隣同士で配置したい場合はこのようになります
<GridLayout columns="*, *">
<Frame col="0"/>
<Frame col="1"/>
</GridLayout><Frame>
<Page>
<ActionBar title="Default Page Title" />
<GridLayout>
<Label text="Default Page Content" />
</GridLayout>
</Page>
</Frame><Frame>
<Page>
<Home />
</Page>
</Frame>import Home from './Home'
export default {
components: {
Home
}
}| Android | iOS |
|---|---|
org.nativescript.widgets.ContentLayout | UINavigationController |