【bug】java.lang.NoSuchMethodError: android.widget.TextView.setBackground

安卓的背景色设置需要根据SDK的版本来分情况考虑:

if (Build.VERSION.SDK_INT >= 16) {
textView.setBackground(null);
} else {
textView.setBackgroundDrawable(null);
}

 

posted @ 2015-05-19 10:24  伟大的臭猪猪  阅读(652)  评论(0编辑  收藏  举报