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 /
  • Help Room /
avatar image
0
Question by · Mar 27, 2016 at 10:43 PM · uiscroll

ScrollRect content/Vertical Layout Group content resets to middle when children altered

The objects I am dealing with have a lot of components so it would be simpler to include **5 images at the bottom**. In short, there is a long list of identical objects created in a scrollable list (parent object is faculty_root). The list utilizes a ScrollRect (technically, a class that subclasses ScrollRect). The content object (faculty_data) has a VerticalLayoutGroup component and a ContentSizeFitter to force the content to expand to the size of the list members. The **issue** is that these elements are expandable vertically, which causes the ScrollRect to reset to the middle. This also causes any attached scrollbar to reset its value to .5. When I click on an element it expands and the elements always instantly reset to the middle. Another effect that this has is that since list items are loaded dynamically, any time an item is added (loading time can be lengthy as there are many network requests), the position resets to .5. I am also having inconsistencies with altering the position of the scrollrect with scrollbar's value, unless I call every frame (which obviously will not work). Any help is greatly appreciated. **I had to include 3 additional images in this imgur link** - Empty faculty data, list item, and expanded list item. http://imgur.com/a/E3Wgb @zeppike asked a similar question although the answer to his problem is not thorough. I have had other related issues related to this as well. ![alt text][1] The root object containing the ScrollRect ![alt text][2] The data that is being scrolled. Contains vertical layout group and content size fitter. [1]: /storage/temp/66791-1-faculty-root.png [2]: /storage/temp/66792-2-faculty-data.png
1-faculty-root.png (265.1 kB)
2-faculty-data.png (124.1 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 · Mar 31, 2016 at 03:24 AM

Alright, I figured it out. Unity interprets the Scroll Rect component in parent "faculty_root" as being of type "Layout Element." Because of that, it conflicts with the "content" child's Content Size Fitter and causes this issue, among others. The issue can be solved by setting the scroll rect script on the content itself and setting the viewport to the parent and the content to itself, or by using nesting.

You can read the original problem and solutions in this thread: http://forum.unity3d.com/threads/layout-group-and-contentsizefitter-in-child.343082/

Comment
Add comment · 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

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

66 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 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

Level Selection Screen 1 Answer

Force a uGUI scrollbar/scrollrect to stay at the bottom when the scrollrect is expanded 0 Answers

Multiple Scroll Not Working 0 Answers

Scroll View optimization with large amount of items 0 Answers

How to prevent scroll rect's content from moving after it reached its borders? 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