- Home /
Help needed with scrollrect in specific UI design
I am struggling quite a bit to implement a specific UI design as I am used to Unreal Engines UI system.
I have been toying around with different components, changed the layout and been reading the docs but haven't been able to get the result I want so I hope someone would be able to help me. I'll give a quick overview of the desired UI design and then present the problem I have.
The design consists of:
A text in the top left corner (like a title)
A dynamically resized panel at the bottom that will parent x buttons
The unfilled UI space (middle) has a scrollwindow that can theoretically parent unlimited texts
The scrollwindow obviously should prevent text from showing above the "top text" and "bottom panel"
I've tried for hours with different gameobject hierarchies and combinations of content size fitter and vertical layout groups. The problem is the scrollwindow. I cannot get it to fit the rest UI dynamically and also have troubles getting the scrollrect script to work properly. Either the content jumps to the bottom or the top, or the viewport isn't resized properly which prevents the content from showing. I cannot count all the different combinations I've tried but I have tried both to create this UI based on my understanding of the docs and through "blind" trial and error. Since I also want the UI to work for different resolutions I cannot simply set the static measurements either.
I hope someone is willing to help me with this issue. If I should provide anymore information regarding anything related to the issue please let me know.
Again sorry for the very broad question and for the possibly bad formatting.
Answer by $$anonymous$$ · Apr 08, 2018 at 07:44 PM
So I managed to find a similar solution that takes my design but horizontally. https://forum.unity.com/threads/fill-empty-space-in-parent-in-ui-layout.452592/
Then I simply added vertical layout groups and content size fitters to each child and setup the scroll rect for the middle element.
I still have a minor problem with the scroll rect since it lets the viewport with the mask get out of bounds but that is a seperate issue.