Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Pop up window layout (auto size with scrollview) help

Discussion in 'Editor & General Support' started by anp, May 10, 2020.

  1. anp

    anp

    Joined:
    Jul 1, 2015
    Posts:
    7
    Hello,
    I am trying to set up a layout for a pop up window, that contains a title, body text and an "OK" button in a vertical layout. I have it set up fine, just the way I want it. The content size dictates window height with fixed width, this is fine. But as you could imagine, at some point, the text content could be so large, that the window height would escape the screen height. The solution that I am looking at right now, is having my text inside a scrollview, but unfortunately, the behavior I am getting doesn't suit me, as the viewport now has fixed size, which does not affect my pop up window size at all.

    I would still like it (window) to expand and shrink based on content size, but in cases where the text is too large, just set the desired max height of the window and rely on the scrollview. I drew some images for a more visual assistance.

    The screen on the left has some body text which expands the window as needed. The screen on the middle, contains little text and the screen on the right has a lot of text that overflows beyond the screen size.

    The orange bar on the right represents a scrollbar, when the text is too large. In this configuration, the size of the window should no longer be affected. Is it even possible to set up a layout like this? If possible, could you help me out setting up this layout with basic steps, for how to set up the layout in unity editor's inspector

     
  2. diggyk

    diggyk

    Joined:
    Aug 16, 2014
    Posts:
    24
    Did you ever figure this out? I'm trying to do the same thing.