android - 如何将 RoundCornerProgressBar 与 ButterKnife 绑定
问题描述
我在 android 中使用RoundCornerProgressBar自定义进度条库,我使用JakeWharton butterknife绑定元素,
所以我试着像
@BindView(R.id.volume_progress_bar) ProgressBar volumeBar;
volumeBar.setProgress(tagVolume); //to increase progress bar value
日志说
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testproject/com.example.testproject.MainActivity}: java.lang.IllegalStateException: View 'volume_progress_bar' with ID 2131296532 for field 'volumeBar' was of the wrong type. See cause for more info.
错误说
查看 ID 为 2131296532 的字段“volumeBar”的“volume_progress_bar”类型错误。
那么如何为RoundCornerProgressBar使用 wright 类型,或者如何增加进度条的值Java
解决方案
这对我有用IconRoundCornerProgressBar
使用黄油刀,我使用如下
@BindView(R.id.volume_progress_bar) IconRoundCornerProgressBarnn volumeBar;
它奏效了。
推荐阅读
- python - 我在哪里初始化或放置我的客户端 ID 以便进行 SOAP 调用?
- firebase - 如何从移动客户端(iOS 和 Android)为 Cloud Functions 上的 HTTPS 触发器发送 Firebase Auth Token ID?
- html - 如何在没有 wtforms 的情况下将 csrf 添加到烧瓶应用程序?
- vim - 终极 Vim/Tmux 窗口重命名脚本
- python - 多个数组的元素最大值(和最小值)
- node.js - 处理 Express 后删除 Multer 上传对象
- python - 无法使用 pip3.6 安装包(找不到pyconfig.h)
- node.js - NodeJS - TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。收到未定义
- apache-spark - Spark 提交不适用于 Protobuf 依赖项
- python - 我已经编写了一个代码来查找html 链接中的标签,并提取每个标签中的数字并进行总结。我正在获取第 17 行的回溯