如何像做下拉导航Android中(因为它看起来像它已成为德precated?) [英] How to do something like Drop Down Navigation in Android (since it looks like it has become deprecated?)
问题描述
编辑:我也问一个相关的问题在这里:<一href=\"http://stackoverflow.com/questions/31019377/android-how-can-i-navigate-from-one-detail-to-another-detail-while-having\">Android:我怎样才能从一个&QUOT导航;详情&QUOT;另一个&QUOT;详情&QUOT ;,而具有&QUOT;截至&QUOT;按钮返回到&QUOT;法师&QUOT;列出?
I also asked a related question here: Android: How can I navigate from one "detail" to another "detail", while having the "Up" button go back to the "Master" list?
怎样使这些对我的应用程序吗? 在我的特殊情况下,我想用一个下拉菜单过滤对我的主从的设计模式我的详细信息查看屏幕,并有一个抽屉,似乎为这种情况下,很怪,虽然看起来像下拉菜单已经成为pcated和导航抽屉取代德$ p $。
How do I make one of these on my app? In my particular instance, I want to use a drop down menu to filter screens on my "Detail" view of my "Master-Detail" design pattern, and having a drawer seems kind of weird for that case, although it looks like Drop-Down-Menus have become deprecated and replaced with Navigation Drawers.
我在这里找到一个模糊的教程 http://developer.android.com/指南/主题/ UI / actionbar.html 的,但我不能在网路上找到任何良好的堆栈溢出问题或任何好的教程,证明这一点。
I found a vague tutorial here http://developer.android.com/guide/topics/ui/actionbar.html , but I can't find any good Stack Overflow questions or any good tutorials on the web that demonstrate this.
我也担心,如果它真的被德precated。我去了我的谷歌日历应用程序,并发现它已经被替换为抽屉,像这样:
I'm also concerned if it has really been deprecated. I went to my Google Calendar app, and found out that it has been replaced with a "drawer" like so:
我只是想要的东西,过滤器,以显示屏幕上的内容,类似这种想法。
I just want something that "filters" what to show on the screen, similar to this idea.
在谷歌的德precated网页,它说:
On Google's deprecated web page, it says:
实施ActionBar.OnNavigationListener定义出现的问题,当用户从列表中选择一个项目。
Implement ActionBar.OnNavigationListener to define the behavior that occurs when the user selects an item from the list.
和它链接到<一个href=\"http://developer.android.com/reference/android/support/v7/app/ActionBar.OnNavigationListener.html\" rel=\"nofollow\">http://developer.android.com/reference/android/support/v7/app/ActionBar.OnNavigationListener.html,
它说:
此接口去precated。操作栏导航模式
德precated,而不是由内嵌工具栏的动作条支持。考虑
使用其他常用的导航模式,而不是
This interface is deprecated. Action bar navigation modes are deprecated and not supported by inline toolbar action bars. Consider using other common navigation patterns instead.
我去了链接, http://developer.android.com/design/模式/ navigation.html ,并不能找到像在下拉菜单中任何东西。它主要谈到了是否应该按向上与后退按钮。
I went to the link, http://developer.android.com/design/patterns/navigation.html, and couldn't find anything like the drop down menu. It mostly talked about whether you should click "Up" vs. "Back" buttons.
因此,如何像做下拉导航Android中(因为它看起来像它已成为德precated?)我只需要开始使用抽屉?在我的特殊情况下,我想用一个下拉菜单来对我的主从的设计模式我的详细信息查看过滤网,并具有抽屉这种情况下,似乎有点不可思议。
So, How to do something like Drop Down Navigation in Android (since it looks like it has become deprecated?) Do I just have to start using drawers? In my particular instance, I want to use a drop down menu to filter screens on my "Detail" view of my "Master-Detail" design pattern, and having a drawer seems kind of weird for that case.
推荐答案
随着21 API方法setNavigationMode(ActionBar.NAVIGATION_MODE_LIST)是pcated德$ P $。
有微调的工作,最好的办法就是使用这样的工具栏:
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" />
您可以在谷歌IO 2014年
这篇关于如何像做下拉导航Android中(因为它看起来像它已成为德precated?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!