您的位置:首页 > 其它

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

2017-11-25 11:08 429 查看


【问题】

如下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、鼠标再次放在此函数上,就可以看到关于此函数的替代方案,以及相关解释。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐