Thursday, April 24, 2014

After the keyboard keys preview is white. Seeking solutions. There figure shows


Figure 1:

Figure
2
I do not know why, after the above point to the number keys, display whiteboard (Figure 1), rather than the preview figure (Figure 2)
keyboardView.setEnabled (true);
keyboardView.setPreviewEnabled (true);
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Font color value is set to white, so invisible.
Reply:
cited a floor reply:
font color value is set to white, so invisible.

Font color in the face of how to set it?

        


Reply:
Plus you can see a preview of the look of digital
keyboardView.setBackgroundColor (Color.RED);
Reply:
reference to the third floor of the reply:
add this to see if you see a preview of the digital
keyboardView.setBackgroundColor (Color.RED);

@ AMinfo

Set the background is not above the preview ... but behind the keyboard itself
Reply:
That explanation is a small window API key feedback popup
But how to set its properties but did not say
Reply:
You customize the keyboard layout is right?
Reply:
reference to the 6th floor aminfo reply:
you to customize the keyboard layout is right?

Yes. Because the first contact with the keyboard, so after reading a keyboardDemo above method according Demo write a layout
I do not know why, methods are basically the same, the function will change under the response content. But that turned into a whiteboard, feeling no place can cause changes in this issue
Reply:
Code and layout made up look.
Reply:
 

android: keyWidth = "35dip"
android: horizontalGap = "0px"
android: verticalGap = "0px"
android: keyHeight = "32dip">














android: keyEdgeFlags = "right"
android: isRepeatable = "true"
android: keyLabel = "cancel" />
android: keyEdgeFlags = "right"
android: isRepeatable = "true"
android: keyLabel = "completed" />






Keyboard Layout
Reply:
 
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: paddingLeft = "5dp"
android: paddingTop = "5dp"
android: layout_below = "@ + id / R_speed">

android: id = "@ + id / keyboard_view"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: layout_alignParentBottom = "true"
android: focusable = "true"
android: focusableInTouchMode = "true"
android: visibility = "gone" />


Keyboard layout in the page
Reply:
 
View view = inflater.inflate (R.layout.item_system, null);
llc.addView (view);
X_speed = (EditText) view.findViewById (R.id.X_speed);
X_speed.setInputType (InputType.TYPE_NULL);
X_speed.setOnTouchListener (new OnTouchListener () {
@ Override
public boolean onTouch (View arg0, MotionEvent arg1) {
/ / TODO Auto-generated method stub
ed = X_speed;
showKeyboard ();
return false;
}
});
keyboardView = (KeyboardView) view.findViewById (R.id.keyboard_view);
keyboardView.setKeyboard (new Keyboard (activity.getApplicationContext (), R.xml.keyboard));
keyboardView.setEnabled (true);
keyboardView.setPreviewEnabled (false);
keyboardView.setOnKeyboardActionListener (new OnKeyboardActionListener () {
@ Override
public void onKey (int primaryCode, int [] keyCodes) {
Editable editable = ed.getText ();
int start = ed.getSelectionStart ();
if (primaryCode == Keyboard.KEYCODE_CANCEL) {
hideKeyboard ();
} Else if (primaryCode == Keyboard.KEYCODE_DELETE) {
if (editable! = null && editable.length ()> 0) {
editable.delete (start - 1, start);
}
} Else if (primaryCode == 57419) {/ / go left
ed.setText (String.valueOf (0 - (Integer.valueOf (ed.getText () toString ()))).);
ed.setSelection (ed.getText (). toString (). length ()) ;/ /
} Else if (primaryCode == 57421) {/ / go right
if (proEdTxt! = null) {
ed.setText (proEdTxt);
hideKeyboard ();
}

} Else {
proEdTxt = ed.getText () toString ();.
editable.insert (start, Character.toString ((char) primaryCode));

}
}

Keyboard java code
Reply:
Code is incomplete ah

showKeyboard (); and hideKeyboard ();

proEdTxt component definitions that did not.
Reply:
reference to the 12th floor of the reply:
code is not complete ah

showKeyboard (); and hideKeyboard ();

proEdTxt component definitions that did not.

This just set the keyboard to show and hide the function, nothing special,
And press figures show whiteboard okay.
keyboardView.setPreviewEnabled (false);
This is not displayed whiteboard, just click the button above, then enter a number in the EditText, the board is set to true
Reply:
Unresolved ah. . . Points do not know how to
Reply:
I suggest you create a new project, leaving only a text box and you customize the keyboard, and then the whole project package sent to the group, we will help you look.
Reply:
But it seems too late to give back to answer
Join the theme
in AndroidManifest.xml
android: allowBackup = "true"
android: icon = "@ drawable / ic_launcher"
android: label = "@ string / app_name"
android: theme = "@ android: style / Theme.Dialog">


Reply:
I'm doing the same thing, are there any prawn urged children about
Reply:
Will @ AMinfo, you are using a mouse click or using the physical keyboard, we need to use the physical keyboard (external Hard keyboard) to achieve clicking keyboards, there key feedback popup
Reply:
Citie helped me a lot, so I do not understand this stuff called bubble had not called balloon tips do not call do not call do not call popup hint less pit father called balloon was originally called the preview!!!

No comments:

Post a Comment