移动浮动操作按钮向上和向下,以避免被阻塞由小吃店小吃店、按钮、操作、以避免

2023-09-07 04:59:26 作者:浪荡少女心﹌

我使用这个库实行浮动的操作栏,我似乎无法找到一个方法来移动按钮时小吃店出现在屏幕上。它甚至有可能与该库?

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?

推荐答案

您可以切换到 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.