
xml布局:
<ImageVIEw androID:layout_centerHorizontal="true" androID:ID="@+ID/favor_item_image" androID:layout_alignParenttop="true" androID:layout_height="wrap_content" androID:layout_wIDth="match_parent" androID:adjustVIEwBounds="true"/>
java代码:
ImageVIEw favorImage = (ImageVIEw) MyVIEw.findVIEwByID(R.ID.favor_item_image); //favorImage.setimageResource(R.drawable.btndelete); favorImage.setBackgroundcolor(color.argb(255,255,0));
所以,当我评论这一行://favorImage.setimageResource(R.drawable.btndelete);我无法设置图像视图背景颜色,但是当我取消注释这一行时,setBackgroundcolor工作正常.
请帮忙.
谢谢
以上是内存溢出为你收集整理的android – 当没有图像资源时,无法设置图像视图的背景颜色全部内容,希望文章能够帮你解决android – 当没有图像资源时,无法设置图像视图的背景颜色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)