摘要: 第1种:tv.setTextColor(android.graphics.Color.RED);//系统自带的颜色类 第2种:tv.setTextColor(0xffff00ff);//0xffff00ff是int类型的数据,分组一下0x|ff|ff00ff,0x是代表颜色整数的标记,ff是表示透明度,ff00ff表示颜色,注意:这里ffff00ff必须是8个的颜色表示,不接受ff00ff这种6个的颜色表示 第3种:tv.setTextColor(this.getResources().getColor(R.color.red));//通过获得资源文件进行设置。根据不同的情况R.color.r 阅读全文
posted @ 2013-06-14 17:54 wangyy 阅读(794) 评论(0) 推荐(0) 编辑
摘要: 在xml中使用android:drawableLeft="@drawable/payicon_type";实现 在控件左侧添加小图标。那么在代码中如何实现同样的效果呢?(上下左右同理)Drawable drawable = getResources().getDrawable(R.drawable.payicon_type);/// 这一步必须要做,否则不会显示.drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());editview.setCompoundDrawa 阅读全文
posted @ 2013-06-14 16:26 wangyy 阅读(705) 评论(0) 推荐(0) 编辑