开发者

Android: button in IME's suggestion bar not clickable

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 t开发者_如何学运维his:

Android: button in IME's suggestion bar not clickable

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?


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

View.inflate(R.layout.suggestion_bar, null);

instead of keeping a reference to the inflater.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜