正确使用Spinner,遵循材料设计指南 [英] Correct usage of a Spinner, following material design guidelines

查看:201
本文介绍了正确使用Spinner,遵循材料设计指南的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读了Google材料设计的新设计指南之后,我没有找到任何明确的设计/显示微调器的解决方案( http://developer.android.com/design/building-blocks/spinners.html )。最近的将是这样的:

components_menus_behavior2.png> http://material-design.storage.googleapis.com/publish/v_1/quantumexternal/0Bx4BSt6jniD7anplVHR3QkdNUHc/components_menus_behavior2.png
- 但我相当肯定会有一些更好的解决方案。特别是如果涉及到微调弹出窗口。即使如此,我在Android studio中没有找到任何微调/菜单元素,所以我认为这将是自定义控件。



我发现的最好的例子是上面链接的菜单,涵盖了旋转元素的功能。



您将推荐什么来显示此类控件并在材质设计范围内。 p>

解决方案

当您的应用主题继承自Material.Theme(或Appcompat)时,微调框将自动适用于材料指南。然后,您可以按照这里所述声明和填充您的微调框: http://developer.android.com/指南/主题/ ui / controls / spinner.html



在Android Studio中,您可以在底部的小部件部分找到微调。 p>

After reading the new design guidelines of Google's material design, I didn't found any clear solution for designing/displaying a spinner (http://developer.android.com/design/building-blocks/spinners.html) in material design.

The nearest would be something like this: http://material-design.storage.googleapis.com/publish/v_1/quantumexternal/0Bx4BSt6jniD7anplVHR3QkdNUHc/components_menus_behavior2.png - but I'm quite sure, there will be some better solution. Especially if it comes to spinner popups. Even so, I didn't find any spinner/menu element out of the Box in Android studio - so I think this would be custom control.

The best example I found is the above linked menu which covers the functionality of an spinner element.

What would you recommend, to display such an control and being in the range of material design.

解决方案

A spinner will be automatically themed correctly for the Material Guidelines when your App Theme inherits from Material.Theme (or Appcompat). You can then declare and populate your spinner like described here: http://developer.android.com/guide/topics/ui/controls/spinner.html

In Android Studio you can find the Spinner in the section "Widgets" at the bottom.

这篇关于正确使用Spinner,遵循材料设计指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆