移动浮动操作按钮向上和向下,以避免被阻塞由小吃店 [英] Moving Floating Action Button up and down to avoid getting blocked by a snackbar
问题描述
我使用这个库实行浮动的操作栏,我似乎无法找到一个方法来移动按钮时小吃店出现在屏幕上。它甚至有可能与该库?
I'm using this library to implement a floating action bar and I can't seem to find a way to move the button when a snackbar appears on screen. Is it even possible with that library?
推荐答案
您可以切换到<一个href="https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html"相对=nofollow> android.support.design.widget.FloatingActionButton 和使用的 CoordinatorLayout 指定行为你的看法。
You could switch to android.support.design.widget.FloatingActionButton and use CoordinatorLayout to specify Behaviors for your views.
CoordinatorLayout是一个超级动力的FrameLayout。
CoordinatorLayout is a super-powered FrameLayout.
CoordinatorLayout是为两个基本用例:
CoordinatorLayout is intended for two primary use cases:
- 作为一个顶级应用程序的装饰或铬布局
- 作为一个容器有一个或多个子视图的特异性相互作用
通过指定行为的CoordinatorLayout子视图可以提供很多 在一个单亲不同的相互作用和这些意见也可以 与人交往。视图类可以指定一个默认行为 作为CoordinatorLayout的使用DefaultBehavior孩子使用时 注释。
By specifying Behaviors for child views of a CoordinatorLayout you can provide many different interactions within a single parent and those views can also interact with one another. View classes can specify a default behavior when used as a child of a CoordinatorLayout using the DefaultBehavior annotation.
行为可被用于实施各种相互作用和 附加布局的修改,从抽屉的滑动和 面板刷卡,dismissable元素和按钮,坚持其他 因为他们移动和动画元素。
Behaviors may be used to implement a variety of interactions and additional layout modifications ranging from sliding drawers and panels to swipe-dismissable elements and buttons that stick to other elements as they move and animate.
一CoordinatorLayout的患儿可有一个锚。这种观点ID必须 对应CoordinatorLayout的任意后代,但它 可能不是锚定的子本身或锚定的后代 儿童。这可以用来放置相对于其他浮动次 任意内容窗格。
Children of a CoordinatorLayout may have an anchor. This view id must correspond to an arbitrary descendant of the CoordinatorLayout, but it may not be the anchored child itself or a descendant of the anchored child. This can be used to place floating views relative to other arbitrary content panes.
这篇关于移动浮动操作按钮向上和向下,以避免被阻塞由小吃店的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!