Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行就会报错 #312

Closed
JayZhaoBoy opened this issue Jun 29, 2017 · 7 comments
Closed

运行就会报错 #312

JayZhaoBoy opened this issue Jun 29, 2017 · 7 comments

Comments

@JayZhaoBoy
Copy link

Error:(252, 61) 错误: 找不到符号
符号: 类 Builder
位置: 类 OptionsPickerView
Error:(252, 124) 错误: <匿名>不是抽象的, 并且未覆盖OnOptionsSelectListener中的抽象方法onOptionsSelect(int,int,int)
Error:(253, 13) 错误: 方法不会覆盖或实现超类型的方法

代码如下
//条件选择器
OptionsPickerView pvOptions = new OptionsPickerView.Builder(this, new OptionsPickerView.OnOptionsSelectListener() {
@OverRide
public void onOptionsSelect(int options1, int option2, int options3 ,View v) {
//返回的分别是三个级别的选中位置
String tx = num1.get(options1);
}
}).build();
pvOptions.setPicker(num1);

@JayZhaoBoy
Copy link
Author

写的时候是不会报错的 再次ctrl + f9 或者直接运行 就会报错
ctrl+左键点进去Builder类都是有的啊 这错误报的我一脸懵逼 求解释 很急 代码就是按照你们demo来的

@MankinChung
Copy link
Contributor

MankinChung commented Jun 30, 2017

public interface OnOptionsSelectListener {
- void onOptionsSelect(int options1, int option2, int options3);
+ void onOptionsSelect(int options1, int option2, int options3, View v);
}

你使用的版本不是最新的,所以OnOptionsSelectListener 接口是不一样的,方法签名不一样

并且未覆盖OnOptionsSelectListener中的抽象方法onOptionsSelect(int,int,int)

你更新一下版本就好了

@JayZhaoBoy
Copy link
Author

关键我依赖的是 3.2.5啊

@JayZhaoBoy
Copy link
Author

你们还有更新的版本?

@xiaosong520
Copy link
Member

@githubofjay 不是版本问题,检查一下import是否有误,看看this 是不是填错了,参数需要填Context对象

@JayZhaoBoy
Copy link
Author

import com.bigkoo.pickerview.OptionsPickerView;
context穿的是activity
我按ctrl+左键去看源码的时候是正常的 Builder也有 接口方法也是带view参数的

@xiaosong520
Copy link
Member

@githubofjay clean 一下项目看是否能解决,还是有问题的话,QQ群里面截图发错误日志给我,帮你看看。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants