File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
cocos/platform/android/java/src/org/cocos2dx/lib Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,8 @@ public void run() {
92
92
editBox .setInputMode (6 ); //kEditBoxInputModeSingleLine
93
93
editBox .setReturnType (0 ); //kKeyboardReturnTypeDefault
94
94
editBox .setHintTextColor (Color .GRAY );
95
- editBox .setVisibility (View .INVISIBLE );
95
+ //http://stackoverflow.com/questions/11236336/setvisibilityview-visible-doesnt-always-work-ideas
96
+ editBox .setVisibility (View .GONE );
96
97
editBox .setBackgroundColor (Color .TRANSPARENT );
97
98
editBox .setTextColor (Color .WHITE );
98
99
editBox .setSingleLine ();
@@ -256,8 +257,6 @@ public void run() {
256
257
}
257
258
// TODO: The font size is not the same across all the android devices...
258
259
if (fontSize >= 0 ){
259
- float density = mCocos2dxActivity .getResources ().getDisplayMetrics ().density ;
260
- // Log.e("XXX", "density is " + density);
261
260
editBox .setTextSize (TypedValue .COMPLEX_UNIT_PX ,
262
261
fontSize );
263
262
}
@@ -426,6 +425,7 @@ private static void openKeyboardOnUiThread(int index) {
426
425
Cocos2dxEditBox editBox = mEditBoxArray .get (index );
427
426
if (null != editBox ) {
428
427
editBox .requestFocus ();
428
+ mCocos2dxActivity .getGLSurfaceView ().requestLayout ();
429
429
imm .showSoftInput (editBox , 0 );
430
430
mCocos2dxActivity .getGLSurfaceView ().setSoftKeyboardShown (true );
431
431
}
You can’t perform that action at this time.
0 commit comments