Algo and Math

Android Studio - creare un menù con facilità

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

</menu>

Se invece, aggiungessimo:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:title="Item" />
</menu>

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:title="Aggiorna"

/>
</menu>

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:title="Aggiorna"
android:id="@+id/aggiorna"

/>
</menu>

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:title="Aggiorna"
android:id="@+id/aggiorna"
android:orderInCategory="100"

/>
</menu>

icona creata. Quindi?

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>

<item android:title="Aggiorna"
android:id="@+id/aggiorna"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/aggiorna"

/>
</menu>

Exit mobile version