My FloatingActionButton has some weird lines coming out of it on 4.4 and lower

心不动则不痛 提交于 2019-12-05 03:40:50

Your problem here is that you're making the FloatingActionButton an unexpected size. The FloatingActionButton in the support library only supports two sizes, and it must be set using the fabSize attribute.

You should change:

<android.support.design.widget.FloatingActionButton
            android:id="@+id/play"
            android:layout_width="48dp"
            android:layout_height="48dp"

to be:

<android.support.design.widget.FloatingActionButton
            android:id="@+id/play"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

If you want a smaller version:

<android.support.design.widget.FloatingActionButton
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/play"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fabSize="mini"

Source: http://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!