English 中文(简体)
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 this:

alt text

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.

问题回答

暂无回答




相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...

热门标签