How can I make a layout with rounded corners? I want to apply rounded corners to my LinearLayout
.
相关问题
- Views base64 encoded blob in HTML with PHP
- How can I create this custom Bottom Navigation on
- Illegal to have multiple roots (start tag in epilo
- How to get the background from multiple images by
- Bottom Navigation View gets Shrink Down
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Creating XML Elements without namespace declaratio
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Get Attribute Value From Simple XML Using JQuery /
Function for set corner radius programmatically
Using
1: Define layout_bg.xml in drawables:
2: Add
layout_bg.xml
as background to your layout@David, just put padding same value as stroke, so border can be visible, regardeless image size
If you would like to make your layout rounded, it is best to use the CardView, it provided many features to make the design beautiful.
With this card_view:cardCornerRadius="5dp", you can change the radius.
I've taken @gauravsapiens answer with my comments inside to give you a reasonable apprehension of what the parameters will effect.
If you're just looking to create a shape that rounds the corners, removing the padding and the stroke will do. If you remove the solid as well you will, in effect, have created rounded corners on a transparent background.
For the sake of being lazy I have created a shape underneath, which is just a solid white background with rounded corners - enjoy! :)