This is an overview of the most common usage of ActionBar. For more information about the available properties, methods, or events, head over to the complete API documentation for ActionBar.
<ActionBar>は画面上部にツールバーを提供するためのUIコンポーネントです。
このコンポーネントはAndroidのapp bar、iOSのnavigation barをNativeScriptが抽象化したものです。
<ActionBar title="MyApp" /><ActionBar>
<StackLayout orientation="horizontal">
<Image src="res://icon" width="40" height="40" verticalAlignment="center" />
<Label text="NativeScript" fontSize="24" verticalAlignment="center" />
</StackLayout>
</ActionBar><ActionBar title="My App" android.icon="res://icon" android.iconVisibility="always" />デフォルトでは、枠線が<ActionBar>の下に描かれています。 枠線に加えて、iOSデバイスでは透過フィルターが<ActionBar>に適用されています。
このスタイリングを無くすには、 flatプロパティをtrueに設定します。
<ActionBar title="My App" flat="true" />| 名前 | 型 | 説明 |
|---|---|---|
title | String | バーに表示されるタイトルを設定します。 |
android.icon | String | Androidデバイス上で表示されるアイコンを設定します。 |
android.iconVisibility | String | Androidデバイス上でのアイコンの表示/非表示を設定します。 |
flat | boolean | Androidでは枠線を無くし、iOSでは透過フィルターを無くします。. デフォルトの値はfalseです。 |
| Android | iOS |
|---|---|
android.widget.Toolbar | UINavigationBar |