App Bar (ActionBar/Toolbar): Android Programming
7.5 هزار بار بازدید -
4 سال پیش
-
Tutorial showing how to configure
Tutorial showing how to configure the App Bar (also called ActionBar or Toolbar). Docs: https://developer.android.com/trainin...
1. setSupportActionBar() in onCreate()
2. Create now /res/menu/menu_xyz.xml
- setup any icons, IDs, and names in the xml
3. Show the menu via onCreateOptionsMenu()
4. Handle the menu clicks via onOptionsItemSelected()
5. Enable the left-arrow/back button (called 'up')
- in onCreate(): getSupportActionBar.setDisplayHomeAsUpEnabled(true);
- control its target via the manifest's android:parentActivityName property or
- control its action manually via android.R.id.home in onOptionsItemSelected()
1. setSupportActionBar() in onCreate()
2. Create now /res/menu/menu_xyz.xml
- setup any icons, IDs, and names in the xml
3. Show the menu via onCreateOptionsMenu()
4. Handle the menu clicks via onOptionsItemSelected()
5. Enable the left-arrow/back button (called 'up')
- in onCreate(): getSupportActionBar.setDisplayHomeAsUpEnabled(true);
- control its target via the manifest's android:parentActivityName property or
- control its action manually via android.R.id.home in onOptionsItemSelected()
4 سال پیش
در تاریخ 1399/06/30 منتشر شده
است.
7,541
بـار بازدید شده