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


as title says, floatingactionbutton has weird lines coming out of on 4.4 or lower. on lollipop works fine.

this picture of issue:

fab

the play image doesn't have lines in it. xml:

<android.support.design.widget.floatingactionbutton             android:id="@+id/play"             android:layout_width="48dp"             android:layout_height="48dp"             android:src="@drawable/ic_av_play_arrow"             app:borderwidth="0dp"             app:elevation="6dp"             app:layout_anchor="@+id/image"             app:layout_anchorgravity="center_vertical|right|end"             app:ripplecolor="@color/color_primary_light" /> 

so doing wrong?

edit: goes away if set elevation 0dp think i'll older phones

your problem here you're making floatingactionbutton unexpected size. floatingactionbutton in support library supports 2 sizes, , must set using 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 want 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


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -