ImageView的背景图片与R.drawable.xx比较

来源:互联网 发布:php高级工程师证书 编辑:程序博客网 时间:2024/05/19 03:46

ImageView  img = findViewById(R.id.img);

ConstantState imgState = img.getDrawable().getConstantState() ;

ConstantState drawableState = getResources().getDrawable(R.drawable.xxx).getConstantState();


if( imgState == drawableState ){

}


0 0
原创粉丝点击