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 - это абстракция NativeScript для Android ActionBar и iOS NavigationBar.
<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" />
На iOS и Android внизу ActionBar рисуется маленькая рамка. Кроме того, цвет фона ActionBar на iOS немного отличается от того, что вы указываете, потому что iOS применяет фильтр. Чтобы удалить этот фильтр и рамку, установите свойство flat
в значение true
.
<ActionBar title="My App" flat="true" />
Название | Тип | Описание |
---|---|---|
title | String | Заголовок, отображаемый в ActionBar. |
android.icon | String | Иконка, отображаемая на Android. |
android.iconVisibility | String | Устанавливается, когда иконка видима. |
flat | boolean | Удаляет рамку и цвет фильтра на iOS. Значение по умолчанию - false . |