Android 按钮设置边框实例
来源:互联网 发布:淘宝客通用计划有用吗 编辑:程序博客网 时间:2024/04/28 02:07
以下一Button标签为例:
这里就联系到标签<shape>,设置背景样式、边框、渐变、圆角等,各种效果的使用方法见如下代码
drawable文件夹新建一个nimei.xml,内容如下:
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#c0000000" android:endColor="#c0000000" android:angle="90" /><!--背景颜色渐变 angle为渐变角度--><solid android:color="#00ffffff" /><!-- 背景填充颜色 --><stroke android:width="3dp" android:color="#ff000000" /><!-- 描边,边框宽度、颜色 --><corners android:radius="10dp" /><!-- 边角圆弧的半径 --><padding android:left="3dp" android:top="3dp" android:right="3dp" android:bottom="3dp" /><!-- 四周留出来的空白 --></shape>
然后在button里面引用如下:
<Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮" android:background="@drawable/nimei" />
- Android 按钮设置边框实例
- 给按钮设置边框的实例
- 第三章,设置按钮边框(Android)
- 设置button按钮边框颜色
- Android 设置背景边框
- Android ImageView设置边框
- android的边框设置
- 按钮 无边框 相关css设置
- xib中设置按钮的边框颜色
- Android设置上下边框,或者左右边框
- Android - ImageView 加边框 实例
- Android中GridView设置边框
- android 设置边框圆角
- android GridView设置边框教程!!
- Android设置edittext无边框
- android GridView设置边框教程!
- android控件的边框设置
- android GridView设置边框教程。
- python 系统学习笔记(一)
- Lab树莓派安装httpd,php和mysql
- LazyLoad.js及scrollLoading.js
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- Android的WebView控件载入网页显示速度慢的究极解决方案
- Android 按钮设置边框实例
- malloc的链表,创建链表,遍历链表,插入节点,删除节点
- shello脚本#!/bin/sh -e中的会影响ln的使用
- Spring AOP之基于AbstractAutoProxyCreator的自动代理
- Java Review 12
- 转义字符的使用
- CButtonColumn详解
- c#基础概念之internal 修饰符有什么作用
- new的链表,创建链表,输出链表