我收到了一个错误,但只是在Android Nougat上。
这是包含fragment_main.xml
的 FloatingActionButton
:
<android.support.design.widget.FloatingActionButton
android:id="@+id/btnShowHomeMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:scaleType="fitCenter"
app:backgroundTint="@color/theme_yellow"
android:layout_marginBottom="20dp"
app:fabSize="normal"
app:borderWidth="0dp"
app:srcCompat="@drawable/ic_menu_main" />
这是我的ic_menu_main.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="141dp"
android:height="128dp"
android:viewportWidth="141.4"
android:viewportHeight="128.6">
<path
android:fillColor="#20000000"
android:pathData="M141.4,68.32l-53.03,53.03a25,25 88.59,0 1,-35.36 0l-53.03,-53.03aNaN,NaN NaN,0 1,0 0l42.43,-42.43a40,40 0,0 1,56.57 -0l42.43,42.43ANaN,NaN NaN,0 1,141.4 68.32Z"/>
<path
android:fillColor="#FFF"
android:pathData="M141.38,58.29l-53.03,53.03a25,25 88.59,0 1,-35.36 0l-53.03,-53.03aNaN,NaN NaN,0 1,0 0l42.43,-42.43a40,40 0,0 1,56.57 -0l42.43,42.43ANaN,NaN NaN,0 1,141.38 58.29Z"/>
<path
android:fillColor="#FFffee61"
android:pathData="M0,58.3l49.5,-49.5a30,30 0,0 1,42.4 0l49.5,49.5 -42.4,42.4a40,40 0,0 0,-56.6 0Z"/>
<path
android:fillColor="#FF515151"
android:pathData="M84.89,75.27l-10.61,10.61a5,5 91.17,0 1,-7.07 0l-10.61,-10.61aNaN,NaN NaN,0 1,0 0l10.61,-10.61a5,5 91.17,0 1,7.07 -0l10.61,10.61ANaN,NaN NaN,0 1,84.89 75.27Z"/>
<path
android:fillColor="#FF515151"
android:pathData="M84.82,42.3l-10.61,10.61a5,5 0,0 1,-7.07 0l-10.61,-10.61aNaN,NaN NaN,0 1,0 0l10.61,-10.61a5,5 0,0 1,7.07 -0l10.61,10.61ANaN,NaN NaN,0 1,84.82 42.3Z"/>
<path
android:fillColor="#FF515151"
android:pathData="M67.83,58.27l-10.61,10.61a5,5 90.52,0 1,-7.07 0l-10.61,-10.61aNaN,NaN NaN,0 1,0 0l10.61,-10.61a5,5 0,0 1,7.07 -0l10.61,10.61ANaN,NaN NaN,0 1,67.83 58.27Z"/>
<path
android:fillColor="#FF515151"
android:pathData="M100.89,59.29l-10.61,10.61a5,5 91.17,0 1,-7.07 0l-10.61,-10.61aNaN,NaN NaN,0 1,0 0l10.61,-10.61a5,5 0,0 1,7.07 -0l10.61,10.61aNaN,NaN NaN,0 1,0 0Z"/>
</vector>
我不确定为什么会提供无效的路径数据。谁知道为什么?