我正在制作一个使用带有[+]图标的FloatingActionButton
的应用,并且我正在使用Materian Design Icons库来添加图标。有什么方法可以在我的FloatingActionButton
中使用该库的材质设计图标?
到目前为止,我的FloatingActionButton
代码是
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="56dp"
android:layout_height="56dp"/>
我没有太多其他内容,因为我无法在FAB中找到图标
当然,您需要先将图标图像添加到drawable
文件夹,然后将图标设置为FAB按钮,如下所示:
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="56dp"
android:layout_height="56dp"
app:srcCompat="@drawable/your_icon"
/>