如何在Android中删除FAB按钮的自动填充? [英] How to remove auto padding of FAB button in android?
问题描述
我正在使用FAB按钮来显示个人资料图片,但已经有一些填充.我正在使用以下代码来创建FAB按钮.
I am using FAB button for profile picture but it is already having some padding. I am using following code for creating FAB button.
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/student"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/student"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end"/>
如何删除库自动提供的填充.我还附上了输出的屏幕截图.我想删除这种天蓝色并增加src图像的大小.
How can i remove the padding which is automatically providing by library. I have also attached an screenshot of output. I want to remove this sky blue color and increase the size of src image.
推荐答案
只需将其添加到您的dimens.xml
文件
just add this in your dimens.xml
file
<dimen name="design_fab_image_size" tools:override="true">36dp</dimen>
这可能不适用于第三方库.
This might not work for 3rd party libraries.
这篇关于如何在Android中删除FAB按钮的自动填充?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!