码迷,mamicode.com
首页 > 移动开发 > 详细

Android 图形总结

时间:2016-07-02 10:33:14      阅读:360      评论:0      收藏:0      [点我收藏+]

标签:

1.9patch图

技术分享

2.按钮自定义

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <shape xmlns:android="http://schemas.android.com/apk/res/android">
 3     <!--尺寸-->
 4     <size android:height="20dp" android:width="310dp"/>
 5     <!--背景颜色【单色】填充-->
 6     <solid android:color="#f00"/>
 7     <!--圆角-->
 8     <corners android:radius="50dp"/>
 9     <!--边框-->
10     <stroke android:color="#09f" android:width="2dp" android:dashGap="2dp" android:dashWidth="15dp"/>
11     <!--背景颜色【渐变色】填充-->
12     <gradient android:startColor="#5f913f" android:centerColor="#7575ab" android:endColor="#cc1212" android:angle="45"/>
13 </shape>

技术分享

3.自定义按钮状态

1 <?xml version="1.0" encoding="utf-8"?>
2 <selector xmlns:android="http://schemas.android.com/apk/res/android">
3     <!--选择状态变化-->
4     <!--点击状态-->
5     <item android:drawable="@drawable/b2" android:state_pressed="true"/>
6     <!--普通状态-->
7     <item android:drawable="@drawable/b3"/>
8 </selector>

技术分享

Android 图形总结

标签:

原文地址:http://www.cnblogs.com/TENOKAWA/p/5634868.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!