ImageView的背景图片与R.drawable.xx比较
2016-07-20 16:01
253 查看
ImageView img = findViewById(R.id.img);
ConstantState imgState = img.getDrawable().getConstantState() ;
ConstantState drawableState = getResources().getDrawable(R.drawable.xxx).getConstantState();
if( imgState == drawableState ){
}
ConstantState imgState = img.getDrawable().getConstantState() ;
ConstantState drawableState = getResources().getDrawable(R.drawable.xxx).getConstantState();
if( imgState == drawableState ){
}
相关文章推荐
- HDOJ 1997 汉诺塔VII 【递归】
- 矩阵原地转置,空间复杂度为O(1)(暂时先保存下来)
- Android静态安全检测 -> 日志泄漏风险
- Codeforces Round #363 (Div. 2) A
- 【Intellij】导入 jar 包
- 最小生成树(kruskal)
- rtrim函数的一个坑
- 黑马程序员: PHP零基础土木研究生,如何做到毕业年薪20万?
- javascript多个圆点弧线运动效果
- 深入理解Java的接口与抽象类
- 程序员的八个级别-拿来分享下
- jersey+grizzly学习笔记
- PowerShell提示,因为此系统中禁止执行脚本
- Java 操作Oracle数据库(建表,插数据,删除)
- 软件开发不可与建筑类比
- [LeetCode] 37. Sudoku Solver
- URI和URL的区别(转载)
- [leetcode]229. Majority Element II
- web中spring与jpa整合
- Jquery对复选框CheckBox的操作