【发布时间】:2020-02-27 19:50:26
【问题描述】:
一旦我听说如果你不能做某事 15 分钟寻求帮助...我已经尝试了 2 天。
现在我需要你的帮助。
我想在 android studio 的 AppBar 底部制作晶圆中心切割
屏幕 2 中的代码
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ActionMenu">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primaryDarkColor"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include
android:id="@+id/include"
layout="@layout/content_action_menu" />
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar2"
style="@style/Widget.MaterialComponents.BottomAppBar.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/primaryDarkColor"
app:fabAttached="true"
android:gravity="bottom"
app:elevation="8dp"
app:fabAlignmentMode="center"
app:layout_anchor="@+id/include"
app:layout_anchorGravity="bottom|center" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
app:elevation="8dp"
app:layout_anchor="@+id/bottomAppBar2"
app:layout_anchorGravity="center|fill_vertical"
app:srcCompat="@android:drawable/ic_menu_add" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
如何在AppBar底部切割fab center?
感谢关注
【问题讨论】:
-
请您在提问时更具体一些。尝试一次将问题归结为一个问题,然后提供/添加代码,以便其他人可以重现您的问题。
标签: android android-studio android-layout floating-action-button android-bottomappbar