Single-line GUI.TextField with custom GUIStyle

I meet some troubles when I try to make input field with custom style on
I need a keyboard without any additional fields, only buttons. When I make

TouchScreenKeyboard.hideInput = true;

it works perfectly, but when I try to use my GUIStyle for customize font
and background of input field, it becomes a multiline, and hideInput
becomes useless.

There are example of my code:

GUIStyle myCustomStyle = new GUIStyle();
myCustomStyle.font = Resources.Load("myfont") as Font;
myCustomStyle.normal.textColor =;
GUI.TextField(new Rect(0,0,200,50), "hello world!", myCustomStyle);

As a result, I get a multi-line input field (but if I call GUI.TextField
without specified GUIStyle, it is single-line), and hideInput does not have
any effect with this field.

How can I make single-line GUI.TextField with custom GUIStyle?

Check font size, is it same as default font, if not make it same.
Also, you can set your GUIStyle wordWrap to false and clipping set to clip like

myCustomStyle.wordWrap = false;
myCustomStyle.clipping = TextClipping.clip;

I check imagePosition and it is TextOnly.
But when I digging around, I found out what I was stupid.
Problem appears not when I specify style, but when i specify max length and style.
I.e. code like

someString = GUI.TextField(someRect, someString, 40);


someString = GUI.TextField(someRect, someString, myStyle);

works perfectly, like simple

someString = GUI.TextField(someRect, someString);

but I get multi-line text field when I make

someString = GUI.TextField(someRect, someString, 40, myStyle);

Sorry for misleading you in my previous posts.

Found this old topic while searching for something else, in case someone would be interested in this though… maybe it would be worth trying

GUIStyle myStyle = new GUIStyle(;
someString = GUI.TextField(someRect, someString, 40, myStyle);