android 控件自定义样式

一、按钮(Button)

方式1.存在.9图片或图片时

 

可在drawable文件夹下新建xml文件style_button_one.xml,代码如下

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/login_active" />
<item android:drawable="@drawable/login" />
</selector>

方式二.自己动手画
http://blog.csdn.net/wswqiang/article/details/6616306

使用时在控件中使用 android:background="@drawable/style_button_one"


posted @ 2016-07-15 10:44  化身程序猿  阅读(286)  评论(0编辑  收藏  举报