【发布时间】:2016-04-12 03:12:39
【问题描述】:
我有一个 FloatingActionButton,它的 src 属性绑定了一个 SVG 图像。但它没有查看我需要的大小,如何调整它以显示更大的图像?
这是我的可绘制对象:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
这是我的观点:
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_add_24dp" />
【问题讨论】:
-
您是否尝试在视图中为 FAB 指定宽度和高度而不是 wrap_content?
标签: android android-studio svg view android-gradle-plugin