Android:IME 建议栏中的按钮不可点击
我将 InputMethodService
子类化以创建我自己的个人键盘。很多东西已经很好用了。但现在我正在使用建议栏(也称为“候选视图”)。现在我只是尝试加载一个带有一个按钮的静态布局:
@Override public View onCreateCandidatesView() {
LayoutInflater mLayoutInflater = LayoutInflater.from(this);
mView = mLayoutInflater.inflate(R.layout.suggestion_bar, null);
return mView;
}
结果如下所示:
这正是我所期望的,但有一个大问题:建议栏中的按钮根本无法选择或点击。
有什么想法吗?
I'm subclassing InputMethodService
to create my own personal keyboard. A lot of stuff already works quite nice. But now I'm playing around with the suggestion bar (also called "candiate view"). For now I'm just trying to load a static layout with one button in it:
@Override public View onCreateCandidatesView() {
LayoutInflater mLayoutInflater = LayoutInflater.from(this);
mView = mLayoutInflater.inflate(R.layout.suggestion_bar, null);
return mView;
}
The result looks like this:
Which is exactly what I expected, but with one big issue: the button in the suggestion bar is not selectable or clickable at all.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否实现了您认为的点击等接口?此外,View 类有一个静态方法来膨胀视图,因此您可以直接说,
而不是保留对膨胀器的引用。
Did you implement the interfaces for clicking, etc in your view? Also the View class has a static method to inflate views so you can just say
instead of keeping a reference to the inflater.