- Home /
ScrollView disappears shortly after starting the game (Android)
scrollPosition = GUI.BeginScrollView(new Rect(100,100, 200, 100), scrollPosition, new Rect(0, 0, 100, 500), false, true);
//foreach(var pair in dt.Rows)
//{
// top++;
//Debug.Log(pair["name"]);
GUI.Label(new Rect(10, top * 20, 100, 20), "test" , style);
//}
GUI.EndScrollView();
In the editor on the PC, everything works. When I start the game on a mobile device, display disappears after about 5-10 seconds.
What could it be?
Answer by Bunny83 · Mar 17, 2014 at 04:03 PM
There has to be something in your script(s) which either disables the script or destroys the script / gameobject. OnGUI is called on all active and enabled gameobjects, even without any camera in the scene.
Maybe you have platform dependent code which only affects mobile? Maybe there's something else in your script which we don't know about?
Yes you are right, I cleaned and external calls do not seem to disappear.
Your answer
Follow this Question
Related Questions
Vertical scrolbar unity android 0 Answers
Why is my vertical layout group not spaced correctly? 1 Answer
ScrollRect (Elastic) wait to scroll back to Start 1 Answer
UI elements change position 0 Answers
Scroll view/rect broken on Android only 0 Answers