代码
<ImageView
android:id="@+id/imageview"
android:layout_width="100dp"
android:layout_height="100dp"
/>
imageView=(ImageView)super.findViewById(R.id.imageview);
imageView.setBackground(0xff6666);
布局也就是只有一个imageview。运行效果如下:
imageview的用colorDrawable设的背景显示不出来,请问怎么解决?
http://blog.csdn.net/leehong2005/article/details/9127463
使用setbackgroundColor去设置背景颜色, setBackground接收的是drawable的参数, 将颜色值传过去无效
imageView.setBackgroundColor(Color.parseColor("#ff6666"));