Now all methods related to navigation modes in the ActionBar
class, such as setNavigationMode()
... are now deprecated.
The documentation explains:
Action bar navigation modes are deprecated and not supported by inline toolbar action bars. Consider using other common navigation patterns instead.
In my current application, there is a spinner on ActionBar. How do I apply NAVIGATION_MODE_LIST
on the new widget Toolbar in the new version appcompat v7 21.
Thanks in advance.
With the API 21 the method setNavigationMode(ActionBar.NAVIGATION_MODE_LIST)
is deprecated.
The best way to work with a spinner is to use a Toolbar like this:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_actionbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:background="?attr/colorPrimary">
<Spinner
android:id="@+id/spinner_toolbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>
You can find an example in the Google IO 2014
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With