gpt4 book ai didi

Android - 如何在 2 个布局之间放置 fab 菜单(来自 yavski 库)

转载 作者:行者123 更新时间:2023-12-05 01:24:02 26 4
gpt4 key购买 nike

我正在使用来自 yavski library 的 float 操作菜单我试图将它放在 2 个布局之间,就像在 this 中一样问题:

但是当我使用 yavski 库中的 fab - menu 进行操作时,它不起作用......

我该怎么办?

编辑

我在标题和“cardview”(link)之间添加了按钮。

enter image description here

当我在其中向下滑动并使用 fab 的默认库时,它运行良好(向上滑动时按钮消失并出现)。但是当我使用特殊的时,它一开始看起来不错,但是当我向下滑动时,它并没有消失,它也向下滑动......

enter image description here

最后一个问题是,当按钮被点击时,它会向上移动一点......

enter image description here

最佳答案

“一个简单的库结合了 FAB + ...”

我不使用您提到的这个特殊库,但是使用默认库它可以像这样工作,如果创建投影的人工作得很好,它也应该:

 <android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white">

//Content

</LinearLayout>

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
android:onClick="process"
android:src="@drawable/ic_add"
app:layout_anchor="@id/ANCHOR_VIEW"
app:layout_anchorGravity="bottom|right|end"
app:backgroundTint="@color/accent"/>

</android.support.design.widget.CoordinatorLayout>

关于Android - 如何在 2 个布局之间放置 fab 菜单(来自 yavski 库),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38446120/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com