Andriod: The method getDrawable(int) from the type Resources is deprecated,一系列问题

来源:互联网 发布:织梦cms个人博客模板 编辑:程序博客网 时间:2024/06/06 09:21

【问题】

如下android代码:

   Drawable statusQuestionDrawable = resources.getDrawable(R.drawable.status_question);   statusView.setBackgroundDrawable(statusQuestionDrawable);

结果提示:

The method setBackgroundDrawable(Drawable) from the type View is deprecated

【解决过程】

1.很明显是该函数被废弃了。

但是换成啥,目前不知道。

2、鼠标放在此函数上,弹出的提示窗口,点击替换栏。


3、鼠标再次放在此函数上,就可以看到关于此函数的替代方案,以及相关解释。


    
    



阅读全文
0 0