标题是很自我解释的。
以下代码不会在“浮动操作”按钮下面显示阴影。 可以做什么来渲染阴影? 这个功能真的不支持API 21+吗?
<android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable/ic_add" android:clickable="true" />注意:添加android:elevation不会在API 21上添加阴影。
从dandar3的示例中截取的屏幕截图: https : //github.com/dandar3/android-support-design
The title is pretty self explaining.
The following code does not render shadow below the Floating Action Button. What can be done to render shadow? Is this feature really not supported even on API 21+?
<android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable/ic_add" android:clickable="true" />Note: Adding android:elevation does not add shadow on API 21.
Screenshot taken from the example by dandar3: https://github.com/dandar3/android-support-design
最满意答案
只需设置app:borderWidth="0dp"解决这个问题。
注意:不要忘记添加xmlns:app="http://schemas.android.com/apk/res-auto"到您的根布局。
这个问题应该在下次发布的Android设计库中解决。
Simply setting app:borderWidth="0dp" resolve this issues for me.
Note: don't forget to add xmlns:app="http://schemas.android.com/apk/res-auto" to your root layout.
This issue should be fixed in next release of android design library.
更多推荐
API,android,shadow,dandar,阴影,电脑培训,计算机培训,IT培训"/> <meta name="
发布评论