Java 如何集成可扩展的浮动操作按钮
我是使用Java开发android的初学者, 我试过上网,但没用。 库的名称是什么,我可以使用它来制作可扩展的浮动操作按钮,如下图所示。Java 如何集成可扩展的浮动操作按钮,java,android,Java,Android,我是使用Java开发android的初学者, 我试过上网,但没用。 库的名称是什么,我可以使用它来制作可扩展的浮动操作按钮,如下图所示。 请帮忙 我在看一些源代码。我找到了一个最好的可扩展晶圆厂(浮动操作按钮) 让我添加这些源代码。 将其添加到build.gradle implementation 'com.nambimobile.widgets:expandable-fab:1.0.2' 将以下源代码添加到布局中 <!-- This is NOT a root view, but sh
请帮忙
我在看一些源代码。我找到了一个最好的可扩展晶圆厂(浮动操作按钮) 让我添加这些源代码。 将其添加到build.gradle
implementation 'com.nambimobile.widgets:expandable-fab:1.0.2'
将以下源代码添加到布局中
<!-- This is NOT a root view, but should be a child of whatever root view you
choose (CoordinatorLayout, ConstraintLayout, etc) -->
<com.nambimobile.widgets.efab.ExpandableFabLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The next 3 Views will only display in portrait orientation -->
<com.nambimobile.widgets.efab.Overlay
android:layout_width="match_parent"
android:layout_height="match_parent"
app:overlay_orientation="portrait"/>
<com.nambimobile.widgets.efab.ExpandableFab
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="@dimen/ui_margin_medium"
android:layout_marginEnd="@dimen/ui_margin_medium"
android:layout_marginRight="@dimen/ui_margin_medium"
app:efab_orientation="portrait"/>
<com.nambimobile.widgets.efab.FabOption
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fab_orientation="portrait"
app:label_text="Portrait Option 1"
android:onClick="onClickPortraitOption1"/>
<!-- The next 3 Views will only display in landscape orientation -->
<com.nambimobile.widgets.efab.Overlay
android:layout_width="match_parent"
android:layout_height="match_parent"
app:overlay_orientation="landscape"/>
<com.nambimobile.widgets.efab.ExpandableFab
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="@dimen/ui_margin_medium"
android:layout_marginEnd="@dimen/ui_margin_medium"
android:layout_marginRight="@dimen/ui_margin_medium"
app:efab_orientation="landscape"/>
<com.nambimobile.widgets.efab.FabOption
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fab_orientation="landscape"
app:label_text="Landscape Option 1"
android:onClick="onClickLandscapeOption1"/>
</com.nambimobile.widgets.efab.ExpandableFabLayout>
然后,您可以像在Java文件中使用on按钮一样使用这些FAB
让我补充一点,如果你的答案正确的话。然后,您可以将其标记为正确答案。因此,其他人可以很容易地找到答案