浮动操作按钮阻止其他组件 [英] Floating Action Button blocking other components

查看:39
本文介绍了浮动操作按钮阻止其他组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google的新Material Design建议使用浮动操作按钮来吸引用户注意该屏幕上的主要操作.列表视图中有很多这样的示例.

The new Material Design of Google recommends to use floating action buttons to draw attention to the user for the main action on that screen. There are quite a lot of examples of this within a list view.

现在,假设您的列表视图有足够的项目来填满屏幕,从而无法滚动.如果您的列表项具有用户可以与之交互的某个组件,例如开关或喜欢的星星,则浮动操作按钮可能会阻止此组件.我们应该如何处理这种情况?

Now, suppose your list view has just enough items to fill the screen, making scrolling impossible. If your list items have a certain component that the user can interact with, for example a switch or a favorite star, its possible that the floating action button is blocking this component. How should we handle this case?

编辑:实际上,该总是与列表中的最后一项发生

EDIT: This actually always happens with the last item in your list

推荐答案

添加一个空白视图,其高度与列表页脚中的浮动按钮相同.因此,当您滚动列表时,将显示最后一项,并且浮动按钮将不会隐藏列表的最后一项.这是一个简单快捷的解决方案.

Add a blank View with the same height as floating button in footer of list. So when you scroll your list, last item will come up and floating button will not hide last item of list. This is a simple and quick solution.

这篇关于浮动操作按钮阻止其他组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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