In the Material Design guidelines Google presented a new style of button, the FAB Button. I found instructions how to make it but I have trouble adding the shadow. How can this be achieved?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Check out the "activity.java", there is probably the code you need.
I made the Fab - Button like this:
layout.xml
ripple.xml
fab.xml
Activity.java
This code will be shown as error in android studio v0.8.1, so as other android l components. It will be fixed in the next version.
Result:
The problem with the circular shadow can be easily solved without any tricks with
Outline
: just add these properties to the button in the XML layout (in addition to the custom background):Although Android Studio may display it wrong in the layout preview, it works fine when launched on a device.
You can use a Button:
where the
ic_action_add
is your icon.drawable/ripple.xml is:
anim/anim.xml is:
Dimens.xml is
With the elevation attribute you should set the Outline via code: