1, I have a keyboard (keyboardview), which covered the entire lower half of the screen to
2, I have a number of candidates (textview), it is to draw a specified location on keyboardview of
Will:
1, what kind of layout should I use?
2, I do not want to use findviewbyid textview method to initialize (ie not written in xml inside), but the background initialization process, but how to set it up on keyboardview the absolute position?
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Try to use the relative position, do not use a linear layout with absolute, relative layout inside, and then you say each module is loaded
Reply:
As a side note, I was inflate out of this inputView inputView = (KeyboardView) getLayoutInflater (). Inflate (R.layout.input, null), how do I give this inputView dynamically add controls (TextView) it?
Reply:
Relative layout with it, you need to inherit the KeyboardView inputView RelativeLayout;
At this point if you want to dynamically add TextView, you can use the following statement:
TextView textView = new TextView (this);
textView.setId (1);
textView.setText ("test");
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams (
-2, -2);
params.addRule (RelativeLayout.ALIGN_PARENT_BOTTOM, -1) ;/ / the layout of the bottom
inputView.addView (textView, params);
Reply:
Can not. . KeyboardView inheritance is another thing, can not inherit other
Reply:
Does anyone understand the android's InputMethodService ? I would like to ask how can we give this service to create a new view (outside keyboardview and candidateview's)?
No comments:
Post a Comment