有没有办法把 float 放在开始处
我发现 app:fabAlignmentMode
只有 2 个选项(center 、 end )
<attr name="fabAlignmentMode">
<!-- Mode that aligns the fab to the center. -->
<enum name="center" value="0"/>
<!-- Mode that aligns the fab to the end. -->
<enum name="end" value="1"/>
</attr>
有没有办法把它放在开头
最佳答案
暂时我找不到好的解决方案,所以你可以尝试像我这样的解决方法:
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/attachment_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom" />
<LinearLayout
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/_40sdp"
android:orientation="horizontal"
app:layout_anchor="@+id/attachment_layout">
<!-- put some button menu here-->
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabCustomSize="@dimen/_50sdp"
android:layout_marginBottom="@dimen/_15sdp"
android:layout_marginStart="@dimen/_20sdp"
app:layout_anchor="@id/bottom_bar" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
关于android - 如何将 float 放在bottomAppBar的开头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64006700/