FloatingActionButton, square button below API level 17

我只是一个虾纸丫 提交于 2019-11-28 11:17:52

This is known by Google and will be fix soon in the next version of the Design Support Library, see this issue: FAB Appears as a square on API 16. It should only concern API 16.

The workaround, proposed in the same thread, is to add app:borderWidth="0dp" to your FAB.

Finally the issue has been fixed in the new release

  compile 'com.android.support:design:22.2.1'

this will solve the square layout issue in API 16. FAB performs well if you place it inside Coordinate Layout. Check out https://code.google.com/p/android/issues/list?can=1&q=label:Version-22.2.1 for issues and fixes in new version.

Released version 22.2.1 This release contains bug fixes related to FAB

https://code.google.com/p/android/issues/detail?id=175067

Change your gradle

compile 'com.android.support:design:22.2.1'

Install support repository revision 16. So you can avoid the workaround [app:borderWidth="0dp"]

If it helps, I solved my issue by removing

android:background 

It was a remnant from the previous FAB library I used. The design library's gets the color automatically from colorAccent.

Saravanan

Add the following attribute to the xml floating button

app:borderWidth="0dp"
Radhey

use different library projects which supports floating action button below API level 17 . you can find easily here .plz refer this .

Floating Action Button

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