Once it appears and others do not, attached codig manifes
Code AddMenuItems
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
''CreateResource(values-v20, theme.xml,
''<resources>
'' <style name="LightTheme" parent="@android:style/Theme.Material.Light">
'' <item name="android:colorPrimary">@color/actionbar</item>
'' <item name="android:textColor">@color/textColor</item>
'' <item name="android:textColorPrimary">@color/textColorPrimary</item>
'' </style>
''</resources>
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="25"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
' Personalitzar ActionBar
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
<color name="actionbar">#ff3F51B5</color>
<color name="textColor">#ff000000</color>
<color name="textColorPrimary">#ff000000</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
<style name="LightTheme" parent="@android:style/Theme.Material.Light">
<item name="android:colorPrimary">@color/actionbar</item>
<item name="android:textColor">@color/textColor</item>
<item name="android:textColorPrimary">@color/textColorPrimary</item>
</style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
<style name="LightTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
</style>
<style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@color/actionbar</item>
</style>
</resources>
)
Code AddMenuItems
B4X:
Private Sub CrearMenusActivity
Activity.AddMenuItem3(Codi.Lang("Main.MenuItem2","Sincronizar"),"BSincro", LoadBitmap(File.DirAssets, "ic_sincronize.png"), True)
Activity.AddMenuItem3(Codi.Lang("Main.MenuItem1","Crear operación"),"BCrear", LoadBitmap(File.DirAssets, "ic_add.png"), True)
Activity.AddMenuItem3(Codi.Lang("Main.MenuItem10","Crear mensajes"),"BMensaje", LoadBitmap(File.DirAssets, "ic_new_message.png"), True)
Activity.AddMenuItem3(Codi.Lang("Main.MenuItem3","Filtrar"),"BFiltrar", LoadBitmap(File.DirAssets, "ic_search.png"), True)
Activity.AddMenuItem3(Codi.Lang("Main.MenuItem4","Ordenar"),"BOrdre", LoadBitmap(File.DirAssets, "ic_order.png"), True)
Activity.AddMenuItem(Codi.Lang("Main.MenuItem5","Configuración"),"BConfig")
Activity.AddMenuItem(Codi.Lang("Main.MenuItem7","Modo Sincro"),"BModoSincro")
Activity.AddMenuItem(Codi.Lang("Main.MenuItem8","Cambio de usuario"),"BCambio")
Activity.AddMenuItem(Codi.Lang("Main.MenuItem6","Cerrar sesión"),"BLogout")
Activity.AddMenuItem(Codi.Lang("AcercaDe", "Acerca de ..."), "BAbout")
End Sub
Attachments
Last edited: