Shap圆角
来源:互联网 发布:dnf如果合约到期知乎 编辑:程序博客网 时间:2024/05/31 19:23
效果图:
shap:
在main→res→drawable下创建shap_button文件。
shap_button的代码:
<!--定义形状有四个属性:line线形,rectangle长方形,oval圆形,ring环形-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--设置圆角的弧度有五个属性:
radius所有角,
bottomLeftRadius左下角,
bottomRightRadius右下角,
topLeftRadius左上角,
topRightRadius右下角-->
<corners android:radius="15dp"/>
<!--定义控件的渐变颜色-->
<gradient
android:startColor="#cccccc"
android:centerColor="#ccffdd"
android:endColor="#cccccc"/>
布局文件MainActivity里按钮的代码:
<Button
android:background="@drawable/shap_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="测试圆角的显示"
android:id="@+id/button"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
shap:
在main→res→drawable下创建shap_button文件。
shap_button的代码:
<!--定义形状有四个属性:line线形,rectangle长方形,oval圆形,ring环形-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--设置圆角的弧度有五个属性:
radius所有角,
bottomLeftRadius左下角,
bottomRightRadius右下角,
topLeftRadius左上角,
topRightRadius右下角-->
<corners android:radius="15dp"/>
<!--定义控件的渐变颜色-->
<gradient
android:startColor="#cccccc"
android:centerColor="#ccffdd"
android:endColor="#cccccc"/>
布局文件MainActivity里按钮的代码:
<Button
android:background="@drawable/shap_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="测试圆角的显示"
android:id="@+id/button"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
0 0
- Shap圆角
- shap
- Android shap的使用
- Android shap 控件美化
- Android shap的使用
- android shap 画图
- Android开发之shap
- the delegate in c shap
- 关于shap gradient 属性参数
- 汉字转换字符C#(c shap) 代码
- Android开发之Shap自定义图形
- Android开发之Shap自定义图形
- Android开发之Shap自定义图形
- android中Style,Selected,Shap等使用
- 14--6Shap类-----简单的继承
- 使用<shap>为Button加上阴影效果
- 如何把shap文件转成sql
- 使用<shap>为Button加上阴影效果
- 移动端返回箭头的事件
- 整型转换成字符串
- 20170313自动化运维工具
- Git 教程
- 在终端可以import caffe但是在pycharm中No module named caffe
- Shap圆角
- css整体概要
- VS2010自定义背景设置
- 美联(蘑菇街)无线技术分享感想
- 缓存
- 最近在研究安卓的我网络监听(BroadcastReiver)
- java 读取csv文件
- 非对称加密和对称加密、ASE加密、openssl方法加密。
- Google Blockly安卓原生图形化编程详解