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

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

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

 

文章来自:http://www.cnblogs.com/lucky-star-star/p/4513843.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3