x


Remove "Preview text line" above keyboard input text on Android and iPhone

An extra bar is loaded on top of the keyboard on iPhone or Android Devices. Is the a way to remove the extra line where the text is previewed on a mobile device or tablet?

When finished typing you have to press done on the keyboard to submit the text, this also hides the keyboard. If you don't press submit on the keyboard the application doesn't register anything has been typed.

I have a scene where a password needs to be submitted. Next to the password field is my submit button. If the password is typed in and my button pressed without the keyboard submit button being pressed first Unity doesn't register the password. I have to press submit on the keyboard first even though the password is in its text field. This is a double step and is confusing people.

Thanks in advance.

more ▼

asked Jan 19 '12 at 09:20 AM

Richard 3 gravatar image

Richard 3
424 46 50 61

i am also struggling with this, have you come up with a solution?

Jan 25 '12 at 12:30 PM mehowe7

No, not yet. This is proving to be a bit frustrating.

Jan 25 '12 at 01:15 PM Richard 3
(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest
var hit : RaycastHit;

var text : String; var textMesh : TextMesh; var backtextMesh : TextMesh; private var keyboard : iPhoneKeyboard;

function Update(){

if(Input.touches.length > 0){
    if(Input.touches[0].phase == TouchPhase.Began){
       if(Physics.Raycast(camera.ScreenPointToRay(Input.mousePosition), hit, 100)){
         if(hit.collider.CompareTag("Numberplate")){
          numberplateOn();
          if(!iPhoneKeyboard.visible)keyboard = iPhoneKeyboard.Open(text,iPhoneKeyboardType.Default,false,false, false, true);
         }
       }
    }
}

if(keyboard){
    if (mainscript.numberplateType && keyboard.done){
       mainscript.numberplateType = false;
       numberplateOff();
    }

}

this is what i am using. however you cannot use your own text box, you must use the one attached to the keyboard. pressing either the keyboard enter button or the done button calls my function fine which is numberplateOff but you can put your own function there.

more ▼

answered Jan 30 '12 at 11:49 AM

mehowe7 gravatar image

mehowe7
31 15 15 17

the top section is calling the text box to appear

Jan 30 '12 at 11:50 AM mehowe7
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2488
x2000
x555
x195
x3

asked: Jan 19 '12 at 09:20 AM

Seen: 1398 times

Last Updated: Jan 30 '12 at 11:50 AM