To support older versions of Android, there are ways to use a limited set of ActionBar APIs on devices that support API level 11 or higher, while still running If you want to use ActionBar APIs, such as to add navigation modes and modifyĪction bar styles, you should set the minSdkVersion to "11" or greater. Greater, the system applies the holographic theme to each activity, and thus, each activity includes This way, when the application runs on Android 3.0 or In this example, the application requires a minimum version of API Level 4 (Android 1.6), but itĪlso targets API level 11 (Android 3.0). Adding the Action Barīeginning with Android 3.0 (API level 11), the action bar is included in allĪctivities that use the Theme.Holo theme (or one of itsĭescendants), which is the default theme when either the targetSdkVersion orĪttribute is set to "11" or greater. Title bar with a custom action bar layout. To help you, the Action Bar Compatibility sampleĪpp provides an API layer and action bar layout that allows your app to use some of the ActionBar APIs and also support older versions of Android by replacing the traditional Versions of Android older than 3.0, you need to create the action bar in yourĪctivity's layout (because the ActionBar class is not available on older If you want to provide an action bar in your application and remain compatible with Note: If you're looking for information about the contextualĪction bar for displaying contextual action items, see the Menu guide. Landscape handset), showing the logo on the left, navigation tabs, and an action item on the Action bar from the Honeycomb Gallery app (on a (when available) or by an "overflow menu" button in the action bar (when the device does notįigure 1. To an action item are available in the overflow menu, revealed by either the device Menu Widget for even more immediate action behaviors. You can provide instant access to key user actions by placing items from the options menu directly in the action bar,Īs "action items." Action items can also provide an "action view," which provides an embedded Make key actions for the activity (such as "search", "create", "share", etc.) prominent andĪccessible to the user in a predictable way.List you can use as an alternative navigation mode or to refine the current view (such as to sort The action bar provides built-in tab navigation for switching between fragments. Provide consistent navigation and view refinement across different applications.Navigation label, such as the currently selected tab. You might choose to remove the activity title, however, if the current view is identified by a This is accomplished with the app icon or logo on the left side and the activity title. Provide a dedicated space for identifying the application brand and user location.The primary goals of the action bar are to: You can control the behaviors and visibility of theĪction bar with the ActionBar APIs, which were added in Android 3.0 (API level Need to prominently present user actions or global navigation, because the action bar offers users aĬonsistent interface across applications and the system gracefully adapts the action bar'sĪppearance for different screen configurations. You should use the action bar in most activities that Provides user actions and navigation modes. The action bar is a window feature that identifies the application and user location, and
0 Comments
Leave a Reply. |