Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by chetan-rane · Oct 06, 2015 at 03:14 PM · uiunity 4.6scrollviewscrollscrolling

[Solved] need help regarding autolayout in scrollrect

Hi All,

I want to implement the scrollrect which will have 3 different height section. (please refer the attached image).

For ex. Section 1, height = 80pixel Section 2, height = dynamic (as per content) section 3, height = dynamic

all section's width should be equal to parent's panel width Also sections need to be align vertically

I have tried using content size filter, aspect ratio filter, vertical layout group, grid layout group But unable to get the correct result.

alt text

Can someone pls suggest me the correct way to achieve this?

Thanks in advanced Chetan

screen-shot-2015-10-06-at-81157-pm.png (53.7 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by GlatiatorRX · Oct 06, 2015 at 04:44 PM

The new UI is very picky, haha. And you can do things in a million different ways. What I would suggest, is have a hierarchy like this.

ScrollRect (Technically the main panel)

HolderPanel (This will have your content size fitter & a vertical layout group)


TitleText (Both the text component and a Layout Element component)


SectionTwoGrid (Content Size fitter & Grid Layout group)

GridElement (Layout Element component)


SectionThreeVertical (Content Size fitter & Vertical Layout group)

VerticalElement (Layout Element component)

This should give you a generic layout that you can work off of, but anchors, positioning, and scaling is all up to you my friend. Whatever looks good. A word of advice, for your layout group elements, if something does not seem to center correctly, try editing the pivot vectors in the inspector (rect transform).

Any other questions or if this does not work, I will be around to refine this answer for you.

~ Matt

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image GlatiatorRX · Oct 06, 2015 at 04:50 PM 1
Share

Your layout elements will give you your specified widths and heights by the way. So if you want your title to be 80 high, set it your content size fitters to your $$anonymous$$ constraints and make sure the layout elements are all defined as such.

avatar image chetan-rane GlatiatorRX · Oct 06, 2015 at 06:09 PM 0
Share

thanks GlatiatorRX for your tip

avatar image chetan-rane · Oct 06, 2015 at 06:07 PM 0
Share

Hi $$anonymous$$att

thanks for your quick help i am hunting for the solution almost a week now and what i got so far is only frustration very very poor documentation unity provided regarding content size, aspect ration filter and layout groups (as per my knowledge - most of developer need to use these, especially when you have targeted Universal build)

anyway let me try as per your suggestion

if you can help me to setup children of full width (anchor with full width) when parent has vertical component and content size filter. I stuck specifically at this point

thanks a lot friend again for your quick suggestion

avatar image GlatiatorRX chetan-rane · Oct 06, 2015 at 07:01 PM 0
Share

I made a little test scene for you. I hope this works. It has all the elements you wanted, and the width does rescale. But the grid is tricky. You may need to add some other parameters to rescale those, or add a script to do it on the fly. But as of right now, this may help.

https://www.dropbox.com/s/zc835gr1zqck1og/UILayout.zip?dl=0

avatar image chetan-rane GlatiatorRX · Oct 06, 2015 at 08:25 PM 0
Share

Thanks a lot GlatiatorRX for your source code this is what i am looking for perfect example, this will fulfil all my requirement let me understand it thoroughly

you save my life man

Edit how do i convert this comment as accepted ans

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

37 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Scrollable zooming list 0 Answers

How can I programmatically tween a Scroll View to a desired position? 0 Answers

Scroll A Text Once It Reaches The End Of The Viewport 0 Answers

Scroll View: Is there a way to discriminate and accept only certain PointerEvents? 0 Answers

Scroll Rect Min/Max Size 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges