android 圆角边框及图片
2013-08-29 14:16
134 查看
my_wane_shape.xml
快速圆角背景边框实现,不太好用:
注:是图层的累加,字面上是多个层,也就是你可以把多个leyaer放在一起然后一其显现出来,类似于framelayout。
?
wane_shape.xml:
自定义方形圆角背景如下:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="自定义背景颜色"/>
<stroke android:width="3dp" color="#ff000000"/>
<corners android:radius="自定义角度dp" />
{
//或者分步定义没个圆角。
<corners android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"/>
}
</shape>
或者直接使用一种效果
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#99FFFFFF"/>
<corners android:radius="30px"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
调用语句:通常在你所希望的layout背景中应用
android:background="@drawable/my_wane_shape"
2.图片本身加上圆角
?
快速圆角背景边框实现,不太好用:
注:是图层的累加,字面上是多个层,也就是你可以把多个leyaer放在一起然后一其显现出来,类似于framelayout。
?
wane_shape.xml:
自定义方形圆角背景如下:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="自定义背景颜色"/>
<stroke android:width="3dp" color="#ff000000"/>
<corners android:radius="自定义角度dp" />
{
//或者分步定义没个圆角。
<corners android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"/>
}
</shape>
或者直接使用一种效果
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#99FFFFFF"/>
<corners android:radius="30px"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
调用语句:通常在你所希望的layout背景中应用
android:background="@drawable/my_wane_shape"
2.图片本身加上圆角
?
相关文章推荐
- android 圆角边框及图片
- android 圆角边框及图片
- android设置控件样式(边框颜色,圆角)和图片样式(圆角)
- android 圆角图片
- Android圆形图片带边框
- Android布局中实现圆角边框
- Android 自定义Drawable 实现圆角矩形和圆形图片
- Android自定义控件之自定义圆形图片和圆角图片
- Android 圆角图片
- android 图片倒影 bitmap与drawable的转换 把图片处理成指定大小 图片圆角处理 dip转换成px
- Android开发实现图片圆角的方法
- Android 图片缩放,图片圆角处理
- Android图片加载神器之Fresco-圆形圆角二合一[Java代码实现圆形圆角效果]
- 完美的CSS无图片圆角边框效果[有效果图][兼容各个浏览器]
- android shape实现控件圆角,背景,边框等属性
- android 一种图片边框的解决办法
- android 将图片变为圆角
- Android布局实现圆角边框
- Android使用UIL加载圆角图片不显示的问题及解决办法
- Android自己定义圆角ImageView 支持网络图片