How do I shrink a Response Button Template?
How do I shrink a Response Button Template?
The Response Button Template is too large for me (vertical space), but whenever I try to make it smaller, Unity puts it back to where it was. I think this is because of layouts, but I can't figure out which component is setting the size.
Hierarchy:
Content:
Response Button Template:
Response Text:
I would have assumed this is controlled by the Layout Element, but changing the Min Height has no effect.
Re: How do I shrink a Response Button Template?
If you don't expect to have more than 5 responses at any given time, the easiest way to set it up is to turn off the scroll rect:
1. Inspect Response Menu Panel. Deactivate the Scroll Rect component.
2. Inspect Content. Change the Rect Transform to this:
1. Inspect Response Menu Panel. Deactivate the Scroll Rect component.
2. Inspect Content. Change the Rect Transform to this:
Re: How do I shrink a Response Button Template?
I think it's more likely than not that I'll have more than 5 and will need to use that scrollbar. I think that already comes up a at least once in my current code.
Is there a way to shrink them if I still want to use a scroll bar?
Is there a way to shrink them if I still want to use a scroll bar?
Re: How do I shrink a Response Button Template?
Actually that's exactly the same. Just re-enable the Scroll Rect.
Re: How do I shrink a Response Button Template?
That in it of itself did not make the content smaller. It just seemed to move it to the bottom:
Re: How do I shrink a Response Button Template?
Oh, I thought you wanted to make the entire response menu panel smaller. Sorry I didn't read that correctly.
Check the Response Text. If it has a Layout Element, you may need to reduce its Min Height.
Then check the same for Response Button Template.
Finally, check the Content's Vertical Layout Group. Make sure Child Force Expand > Height is not ticked, since this may try to make the content tall enough to fill out the entire viewport height.
Check the Response Text. If it has a Layout Element, you may need to reduce its Min Height.
Then check the same for Response Button Template.
Finally, check the Content's Vertical Layout Group. Make sure Child Force Expand > Height is not ticked, since this may try to make the content tall enough to fill out the entire viewport height.
Re: How do I shrink a Response Button Template?
Unless I'm misunderstanding something, I think my pictures show it already doing all those things. Reducing the layout group's min height makes no difference.
Re: How do I shrink a Response Button Template?
What if you untick the Response Button Template's Vertical Layout Group > Force Expand > Height checkbox?
You might just need to play around with it. Feel free to send me a copy of the UI if you'd like me to take a look and see if I can find settings that make the buttons less tall.
You might just need to play around with it. Feel free to send me a copy of the UI if you'd like me to take a look and see if I can find settings that make the buttons less tall.
Re: How do I shrink a Response Button Template?
In the end, the key was to untick the Content GameObject's Vertical Layout Group > Control Child Size.
Re: How do I shrink a Response Button Template?
Of course (???)!
I know this is more about Unity and your library, but does that make sense to you? I've been trying to learn how Unity layout works ever since I started learning Unity, and have never found a thorough resource. If you happen to know of one, I'd love to read it. I've always been confused by Content Layouts.