scaleType fitCenter works on Lollipop, but not on 4.1 to 4.4
pseisam opened this issue · 1 comments
pseisam commented
I use scaleType="fitCenter" for the image that is used for the fab. While this works on Lollipop as expected (image is properly scaled) it doesn't work on 4.1 to 4.4. There the image is still bigger than the fab.
<com.melnykov.fab.FloatingActionButton
android:id="@+id/myFabButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:scaleType="fitCenter"
fab:fab_colorNormal="@color/fabColor"
fab:fab_colorPressed="@color/fabColor"
fab:fab_colorRipple="@color/fabColorRipple"
android:src="@drawable/ic_refresh" />
I tried the same with a regular ImageButton, but there everything works fine on Lollipop and 4.1 to 4.4.
Am I doing something wrong or is this some kind of bug (since it works with ImageButton)?
AleanHeart commented
hey use size 24dp... you can generate it with Android Asset Studio. http://romannurik.github.io/AndroidAssetStudio/icons-generic.html#source.space.trim=1&source.space.pad=0&size=24&padding=8&color=33b5e5%2C100&name=ic_example