Search Unity

ToolbarSeachTextField cut off.

Discussion in 'UGUI & TextMesh Pro' started by LucaHofmann, Oct 5, 2016.

  1. LucaHofmann

    LucaHofmann

    Joined:
    Feb 24, 2015
    Posts:
    12
    Hello,

    I am using a search textfield in a toolbar.

    Code (CSharp):
    1. GUILayout.BeginHorizontal(EditorStyles.toolbar);
    2. GUILayout.TextField(_searchString, GUI.skin.FindStyle("ToolbarSeachTextField"),  GUILayout.Width(100));
    3. GUILayout.EndHorizontal();
    but the search field gets cut on the right side:
    cut.png

    I played around with the ToolbarSeachTextField styles margin, padding etc. And with GUILayout parameters like width, minWidth etc. but nothing worked.
    Any ideas?
     
  2. GeneticSpartan

    GeneticSpartan

    Joined:
    Feb 22, 2013
    Posts:
    2
    The search bar is made up of a text field and a button. You can add a button after the text field that uses either the "ToolbarSeachCancelButtonEmpty" or "ToolbarSeachCancelButton" styles, depending on if the text field is empty or not.