- Home /
C# - set Size for ScrollView
Hello,
I made a ScrollView inside a window.
scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(UnityEngine.Screen.width-727), GUILayout.Height(UnityEngine.Screen.height-55));
//....
GUILayout.EndScrollView();
I am using my game with a touchscreen. So for thin fingers the defaults are fine. But I would say for thicker fingers the ScrollView is abit too small.
I didn´t find where I can set the width in the parameters or in the skin. Can anyone tell me please how I am able to set the width of this ScrollView?
Thank you in advance.
Answer by Sundar · Oct 04, 2012 at 03:52 PM
Select your Gui Skin in project, then in inspector Horizontal Scroller Thumb -> select Stretch Width or Stretch Height as needed. Similarly you do it for Horizontal scrollerbar. I assume this is a horizontal scroll, if not do the same for vertical.
Thank you, it worked. Additionally I had to increase the "Fixed Width"/"Fixed Height" properties in my Gui Skin.