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 steinjak · Jun 12, 2017 at 09:14 AM · uicanvaslistslayout

When does canvas layout complete?

The case: We're populating the content area of a ScrollRect dynamically when constructing a particular page in the UI - that is, we have a list. The elements of this list have different heights, depending on the amount of content in a Text component.

Timing considerations become important in two distinct cases:

  1. When navigating to this view, we render it to a RenderTexture used in a transition animation. Here, we need to wait until layout is complete before actually rendering the view.

  2. When adding a new element to the list, we'd like to scroll to the bottom so that the user sees the addition. Again, setting the normalizedVerticalPosition to zero before the layout has completed results in it scrolling almost to the end of the list, but not quite.

The following questions arise:

  1. We can request a relayout using LayoutRebuilder and/or registering a canvas element (the scroll rect) with the CanvasUpdateRegistry. But when should we use which? Are there other mechanisms we should know about?

  2. According to the documentation, canvas layout is performed before rendering, at the end of the frame, and we've assumed that waiting in a coroutine with WaitForEndOfFrame should be sufficient to ensure a complete layout, but that doesn't always seem to be the case. Is there a way to get notified when layout has completed?

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 a436t4ataf · May 14, 2020 at 01:39 AM 0
Share

3 years later ... did you find any answers to your questions?

The official docs are still $$anonymous$$IA (I guess no-one at Unity can be bothered to write them), and LayoutRebuilder is still buggy, ... I could fix some of this if I could do basic actions like hooking "canvaslayout begins" (which I have some hacks for) and "canvas layout ends" (nothing seems to work)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by steinjak · May 14, 2020 at 10:44 AM

Hi,

It's a long time since, so I don't I remember exactly, but I think we didn't find any answers - probably we found some kind of workaround, but I'm not sure. We've moved on from Unity since then. Sorry that I can't help...

-steinjak

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Unity crashes when using ExecuteAlways on a UIBehaviour 0 Answers

Nested UI elements and layout 0 Answers

[UI] Grid Layout Group Custom Sort Order 1 Answer

How can I return a Dragged Object From a Layer Group to its Original Position? 0 Answers

How can I edit the horizontal layout group on a panel or object 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