如何在工具栏新appcompat V7 21设置NAVIGATION_MODE_LIST [英] how to set NAVIGATION_MODE_LIST on Toolbar new appcompat v7 21
问题描述
现在与导航模式在动作条
类,如 setNavigationMode()
...是所有方法现在去precated。
Now all methods related to navigation modes in the ActionBar
class, such as setNavigationMode()
... are now deprecated.
该文档解释了:
Action bar navigation modes are deprecated and not supported by inline toolbar action bars. Consider using other common navigation patterns instead.
在我目前的应用中,有动作条上的一个微调。我该如何申请 NAVIGATION_MODE_LIST
在新的widget工具栏在新版本中appcompat V7 21
先谢谢了。
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.
推荐答案
随着21 API的方法 setNavigationMode(ActionBar.NAVIGATION_MODE_LIST)
是<一个href="http://developer.android.com/reference/android/support/v7/app/ActionBar.html#setNavigationMode(int)">de$p$pcated.
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>
您可以找到一个例子谷歌IO 2014年
这篇关于如何在工具栏新appcompat V7 21设置NAVIGATION_MODE_LIST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!