Android 建立View 圆角
2015-09-28 13:40
369 查看
虽然很easy,不过还是录制。
混合参观
在drawable文件下 创建一个布局文件corners_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#000000" /> //圆角View的背景颜色
<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="#000000" />
<corners android:radius="5dp"/>
</shape>
调用非常easy,仅仅须要在用圆角的View中:
android:background="@drawable/corners_bg"
混合参观
在drawable文件下 创建一个布局文件corners_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#000000" /> //圆角View的背景颜色
<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="#000000" />
<corners android:radius="5dp"/>
</shape>
调用非常easy,仅仅须要在用圆角的View中:
android:background="@drawable/corners_bg"
相关文章推荐
- 控件点击变样,离开后控件还原
- Android NotificationManager 和Notification的使用总结 转
- 允许Android对于飞行模拟器
- Android KeyCode列表
- android中全屏或取消标题栏
- Android 个人开发者接入支付功能
- Android 上下文菜单与上下文操作模式
- Android中自定义圆形图片的CircleImageView和RoundedImageView基本使用效果
- android 像素转换
- AndroidStudio集成Git(图文并茂)
- Android桌面组件App Widget完整案例
- Android桌面组件App Widget用法入门教程
- Android Studio在SVN上创建分支
- Android于JNI调用列出的程序
- android四大组件之ContentProvider个人总结
- Android 沉浸式状态栏总结
- Android中使用lambda表达式
- Android中使用lambda表达式
- android多国语言文件夹文件汇总
- Android 5.0(Lollipop)中的SurfaceTexture,TextureView, SurfaceView和GLSurfaceView