- Home /
Buttons in custom editor window act weird need help solving it.
The text inside my buttons is moving when I resize the window look at the link below for a short clip that shows the problem.
I think it's a bug but i'm not sure can anyone confirm this?
Answer by gvergidis · Aug 21, 2018 at 11:21 AM
I do not face this problem to my inspectors. Just tried that at 2018.2.4f1 version and it seems to be ok. Thought, it is not a problem it is just a small "glitch". Try setting a custom theme to your inspector and see if the problem persists.
Try this code and resize the window look at the first button.
using UnityEditor;
using UnityEngine;
public class Test : EditorWindow
{
[$$anonymous$$enuItem("Window/Test")]
public static void Init()
{
Test window = (Test)GetWindow(typeof(Test));
window.Show();
}
void OnGUI()
{
if (GUILayout.Button("Previous", GUILayout.ExpandWidth(false)))
{
}
GUILayout.Space(10f);
if (GUILayout.Button("Next", GUILayout.ExpandWidth(false)))
{
}
}
}
Your answer
Follow this Question
Related Questions
GUILayout three buttons alligned horizontally with no spaces between them 1 Answer
Only one button on the screen will work at a time 1 Answer
Avoid new lines between elements inside a EditorWindow 1 Answer
Bug? Overlay Menu will not open using Space or any other key (2021.2.7) 0 Answers
Undo issues in EditorWindow 0 Answers