简体   繁体   English

Android:素材设计的浮动操作按钮(FAB)和移动视图

[英]Android: material design's Floating Action Button (FAB) and shifting views

I would like to implement two Material Design elements in Android: 我想在Android中实现两个Material Design元素:

  • the Floating Action Button (FAB) 浮动操作按钮(FAB)

  • " shifting views " (not sure if this is the proper term) 转换视图 ”(不确定这是否是正确的术语)

I cannot find any Android widget to implement FAB s. 我找不到任何Android小部件来实现FAB Which is the best recommended solution? 哪个是最佳推荐的解决方案? is it to use third party libraries? 是使用第三方库吗?

With " shifting view ", I mean a view that shifts up and down. 转换视图 ”,我的意思是一个上下移动的视图。 For example if you have two views in a fragment: top view which is fixed, and the bottom view which is a list, by scrolling the list, you can actually make the list take some space of the top view. 例如,如果片段中有两个视图:顶视图是固定的,而底视图是列表,通过滚动列表,您实际上可以使列表占用顶视图的一些空间。 How do you implement that? 你是如何实现的? is it part of the Android framework or you need to use some third party libraries again? 它是Android框架的一部分还是你需要再次使用一些第三方库?

There's no stock Android implementation of FAB , but I've used this implementation of FAB's in couple of my projects and its working great and supports the material greatness! 没有FAB的 Android实现,但我已经在我几个项目中使用了FAB的这种实现,并且它工作得很好并且支持材料的伟大!

so given the fact that there's no FAB implementation on Android, you should go for a 3rd party implementation 因此,鉴于Android上没有FAB实现,您应该选择第三方实施

By shifting views do you mean like toolbar? 通过转换视图你的意思是像工具栏? Like similar to this or this ? 喜欢和这个或者这个相似吗? Its hard to say, now knowing exactly the use case or what do toy mean, but this is what your explanation reminds me of 很难说,现在确切知道用​​例或玩具意味着什么,但这就是你的解释让我想起的

This one here might be pretty useful for any of the other material needed elements (widgets, dialogs, progress bars) and it also covers the FAB. 这里的这个对于任何其他需要的材料(小部件,对话框,进度条)都非常有用,它也涵盖了FAB。 As stated in the other answer, there is no default implementation so the solution would be to go for 3rd party libraries. 如另一个答案所述,没有默认实现,所以解决方案是去第三方库。

And here you can find different ways of implementing what you refer to as "shifting view". 在这里,您可以找到实现所谓“转换视图”的不同方法。 There is a demo app as well and it is easily customizable. 还有一个演示应用程序,它很容易定制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android 设计支持库可扩展浮动操作按钮 (FAB) 菜单 - Android Design Support Library expandable Floating Action Button(FAB) menu 材料设计浮动按钮(FAB)阻止RecyclerView - Material Design Floating Button (FAB) Blocking RecyclerView Android - 可移动/可拖动的浮动操作按钮 (FAB) - Android - Movable/Draggable Floating Action Button (FAB) 滚动/粘性FAB浮动操作按钮android - Scrolling / sticky FAB floating action button android Android L - 浮动操作按钮(FAB) - Android L - Floating Action Button (FAB) Android:具有ExpandableListView的浮动操作按钮(fab) - Android: Floating Action Button (fab) with ExpandableListView Material Design:如何为Android Floating Action Button设置透明度 - Material Design : how to set transparency for Android Floating Action Button Android Material Design中的浮动操作按钮是否有本机组件? - Is there a native component for the Floating action button in Android Material Design? 如何在 Android Material Design 中为浮动操作按钮创建子菜单? - How to create a submenu for Floating Action Button in Android Material Design? 浮动设计按钮在Material Design Android中的用途是什么 - What are uses of Floating Action Button in Material Design Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM