Ho provato questo codice trovato nel forum:
Nel codice orinale ho aggunto istruzione per caricare un icona:
Non da errori di compilazione ma non carica nessun icona.
Potete aiutarmi a capire come posso inserirla?
Editor Manifest è :
Potete darmi una mano?
Grazie mille
B4X:
#Region Project Attributes
#ApplicationLabel: AppCompat1
#VersionCode: 2
#VersionName: 2.0
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Extends: android.support.v7.app.AppCompatActivity
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Spinner1 As Spinner
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("b4a4lay1")
Spinner1.AddAll(Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"))
'Set some ActionBar options
Dim bar As ACActionBar
bar.Initialize
bar.Title = "Simple AppCompat example"
bar.Subtitle = "This is a Subtitle"
bar.Icon = LoadBitmap(File.DirAssets, "gennaro.png")
'bar.Icon
'Activity.AddMenuItem("Test overflow", "Menu")
End Sub
Nel codice orinale ho aggunto istruzione per caricare un icona:
B4X:
Dim bd As BitmapDrawable
bd.Initialize(LoadBitmap(File.DirAssets, "logo.png"))
bar.Icon =bd
Non da errori di compilazione ma non carica nessun icona.
Potete aiutarmi a capire come posso inserirla?
Editor Manifest è :
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
AddManifestText(
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="21"/>
<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.
Grazie mille
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
CreateResource(values, theme.xml,
<resources>
<style name="MyAppTheme" parent="@style/Theme.AppCompat">
<item name="colorPrimary">#FF9800</item>
<item name="colorPrimaryDark">#F57C00</item>
<item name="colorAccent">#FFA726</item>
</style>
</resources>
)
Grazie mille
Last edited: