<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/ft_upload"
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/float_upload"
app:backgroundTint="@color/white"
app:layout_constraintBottom_toTopOf="@+id/constraintLayoutBottom"
app:layout_constraintEnd_toEndOf="parent"
app:maxImageSize="90dp"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/constraintLayoutBottom"
tools:ignore="MissingConstraints">
</com.google.android.material.floatingactionbutton.FloatingActionButton>
上面是一个浮动动作按钮,其中包含来自可绘制对象的图像,问题是该图像似乎与左上角对齐。为什么会造成这种情况?以及如何解决这个问题?
我指的是设置android:scaletype="fitXY"
的答案,但是这个答案不能解决我的问题。
如何解决此问题。任何建议都会有帮助