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
2
Question by baerbel · Nov 25, 2015 at 08:52 PM · scrollviewlayout

Warning when combining content size fitter and vertical layout group

I followed the Unity tutorial on Scrolling menus at runtime. It works quite well. However I see a warning, when adding a Content Size Fitter to the scroll panel, which already has a layout group. (In the video that happens around 12:25 and does not merit a warning).

Parent has a type of layout group component. A child of a layout group should not have a Content Size Fitter component, since it should be driven by the layout group.

The warning would make sense to me, if I had the Content Size Fitter on the children of the scroll panel. But the scroll panels size should not be changed by its Layout group at all, or should it?

Is there a better way to achieve a scroll view in newer versions of Unity or is the warning just appearing in the wrong place?

Comment
Add comment · Show 1
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 castor76 · Feb 24, 2017 at 09:04 AM 0
Share

I can also confirm this warning with grid layerout

3 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Black_Demon · Apr 19, 2017 at 10:00 AM

Although this post is quite old, if someone is looking for the solution, it was answered here

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
avatar image
2

Answer by phil_me_up · Feb 16, 2016 at 01:35 PM

You should set this up with the Content Size Fitter component and the Vertical Layout Group component on the same object. In you're situation this would be something like

->Scroll Rect Object (with scroll rect component)

--->Scroll Container (Content Size Fitter and Vertical Layout Group components)

----->Scroll content 1 (With Layout Element component)

----->Scroll content n (With Layout Element component)

Comment
Add comment · Show 1 · 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 TheEpigone · Oct 10, 2016 at 01:59 AM 0
Share

This is the heirarchy in the tutorial, and the warning described above appears in this setup. I tested it in Unity 5.3.5f1.

avatar image
0

Answer by Ni-Donoso · Jul 17, 2019 at 03:17 AM

Hello Everyone

I had a same problem but I used this method.

content (layout & content fitter)

  • child layout1(layout & content fitter)

  • child layout2(layout & content fitter)

...

  • child layoutn(layout & content fitter)

Code:

int refreshCounter = 0;

void Update() {

 if (refreshCounter > 0)
 {
     refreshCounter --;
 
     if (refreshCounter == 0)
     {
         content .GetComponent<Image>().enabled = !content .GetComponent<Image>().enabled;
     }
 }

}

void ChildProcess() {

 //add or remove elements to or from child layout1~n
 ...
 
 refreshCounter = 2;
 //not 1, because after next first frame, the canvas is rendered

}

@baerbel , @phil_me_up , @Black_Demon

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

11 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

Related Questions

Help needed with scrollrect in specific UI design 1 Answer

How To Enable and Disable ScrollRect? 1 Answer

Layout Element required for scroll views but only on Android 0 Answers

Why is my vertical layout group not spaced correctly? 1 Answer

Scrollview itens aligned like whatsapp 1 Answer


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