android - jumpDrawablesToCurrentState(View) 在 Android 中已弃用
问题描述
检查单选按钮后,我想调用jumpDrawablesToCurrentState(View)
方法,但似乎不推荐使用此方法。
这种方法的新api是什么?
代码:
if (currentLanguage.equals(getString(R.string.LANGUAGE_ENGLISH), ignoreCase = true)) {
settingsRadiogroup.check(radioButtonEn.id)
jumpDrawablesToCurrentState(settingsRadiogroup) //deprecated
} else {
settingsRadiogroup.check(radioButtonBn.id)
jumpDrawablesToCurrentState(settingsRadiogroup) //deprecated
}
解决方案
我认为jumpDrawablesToCurrentState()
里面是通过一个 Drawable 。在此处引用开发人员文档:
此方法在 API 级别 27.1.0 中已弃用。直接使用 jumpToCurrentState() 。调用 Drawable.jumpToCurrentState()。
所以在这种情况下,settingsRadiogroup.jumpDrawablesToCurrentState()
不应该表现出任何弃用。
推荐阅读
- python - 在处理带有 None 的行时,在 pandas 列中提取 JSON 以分隔列
- vba - 如何使用 VBA 将图像裁剪为特定形式,例如 PowerPoint 中的圆圈?
- office365api - asp dotnet core如何连接邮箱
- powershell - 如何模拟点源脚本?
- php - PHP - 多维数组检查重复项(没有 array_unique)
- c# - 使用linq或数据视图过滤器从c#中的DataTable中获取最高日期行
- scala - 类型别名和隐式值解析
- apache-spark - 线程“main”java.sql.SQLException 中的异常:运行 spark-submit 时没有合适的驱动程序
- django - 在 django 中访问 api 时您无权执行此操作
- python - 在 Keras 的 lstm 网络中使用哪个激活函数进行序列预测?