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.
El componente ActionBar es una abstraccio4n de NativeScript del ActionBar
de Android y el NavigationBar
de iOS.
<ActionBar title="MyApp" />
<ActionBar>
<StackLayout orientation="horizontal">
<Image src="res://icon" width="40" height="40" verticalAlignment="center" />
<Label text="ativeScript" fontSize="24" verticalAlignment="center" />
</StackLayout>
</ActionBar>
<ActionBar title="My App" android.icon="res://icon" android.iconVisibility="always" />
Tanto en Android como en iOS, un pequeño borde es dibujado en la parte inferior del componente ActionBar
. Además, el color de fondo del ActionBar
de iOS is levemente diferente al que uno especifíca ya que iOS aplica un filtro. Para eliminar este filtro y el borde, puedes usar el atributo flat
con el valor true
.
<ActionBar title="My App" flat="true" />
Nombre | Tipo | Descripción |
---|---|---|
title | String | El título que se desea mostrar. |
android.icon | String | El ícono para mostrar en Android. |
android.iconVisibility | String | Indica cuando el ícono esta visible o no (solo Android). |
flat | boolean | Elimina el borde y el filtro en iOS. Valor por defecto: false . |