2014年5月16日

Color Drawable

摘要: android的图片资源除了常规图片之外,还支持自定义的颜色图片,分为矩形和圆角矩形。下面分别说明一下这两种自定义图片的用法。1.矩形颜色图片 #f00 #0000ff #f0f0// Get a drawableColorDrawable redDrawable = (ColorDrawab... 阅读全文

posted @ 2014-05-16 17:01 veins 阅读(421) 评论(0) 推荐(0) 编辑

Android按钮设置文字变色ColorStateList

摘要: Windows平台VC,对于不同的按钮状态,采用不同的颜色显示文字,实现起来比较复杂,一般都得自绘按钮。但是Android里面实现起来非常方便。我们首先添加一个ColorStateList资源XML文件,XML文件保存在res/color/button_text.xml:Java代码Java代码Bu... 阅读全文

posted @ 2014-05-16 15:20 veins 阅读(550) 评论(0) 推荐(0) 编辑

导航