Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 tigertrussell · Mar 14, 2015 at 09:43 PM · ui

What is the best method of displaying tabular data with Unity's 4.6+ UI?

The question pretty much says it all.

I'm trying to create clean tables without having to set up a whole bunch of insane anchors.

Tried using a Grid Layout; that doesn't allow me to force the number of columns. Tried using a Vertical Layout holding a bunch of Horizontal Layouts, but I can't lock the Horizontal Layout groups' sizes, so the rows are always skewed.

I've tried a couple searches but haven't found anything, meaning it's either stupid-simple or nobody wants to look at a table in a game :\

Comment
Add comment · Show 5
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 siaran · Mar 14, 2015 at 11:13 PM 0
Share

I'm using unity 5 ins$$anonymous$$d of 4.6, but I checked the Grid Layout Group UI component and I can set the Constraint variable to Fixed Column Count. That's not possible in 4.6?

avatar image tigertrussell · Mar 14, 2015 at 11:16 PM 0
Share

Ha! I knew it (see question): it was stupid-simple. I must have had that section of the window just a little too small and didn't scroll the window down, because I just did not notice that. Go ahead and add answer and I'll give you the points :P

avatar image tigertrussell · Mar 14, 2015 at 11:19 PM 0
Share

Ooh also - is there a way to not use fixed size for the cells of a grid component?

avatar image tigertrussell · Mar 15, 2015 at 12:14 AM 0
Share

Okay; wait... I don't think that's exactly what I want. I'm looking for something that gives me:

  • A fixed number of columns (grid does this)

  • An unlimited number of rows (vertical layout group does this)

  • Cells which can expand automatically... (horizontal layout group does this)

  • ... but when a cell is forced to expand, it ensures that all the other cells in its column match its expansion

Could I do a Horizontal Layout Group holding Vertical Layout Group(s) then?

avatar image tigertrussell · Mar 15, 2015 at 12:50 AM 0
Share

O$$anonymous$$ for now I'm going to actually leave this unanswered, as this is not as easy as it should be. Surely there is a way. The Grid doesn't work, and using a Horizontal Layout Group holding Vertical Layout Group(s) with specific LayoutElement overrides for each of the Vertical Layout Groups (to control column widths and such with $$anonymous$$Width) is the best I can come up with.

There's got to be a better way!

1 Reply

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

Answer by pfreese · Mar 17, 2015 at 01:38 AM

The Grid Layout component does most of what you want, but it assumes a fixed cell size. Probably the best way to handle this for now would be to roll your own layout script, using GridLayoutGroup as a model (basically just changing the fixed cell with to use the max width of the elements in each column. The UI code is Open Source; info on getting it is here: https://bitbucket.org/Unity-Technologies/ui

Comment
Add comment · Show 4 · 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 pfreese · Mar 17, 2015 at 07:18 AM 0
Share

There's also documentation on the Layout interfaces here: http://docs.unity3d.com/$$anonymous$$anual/UIAutoLayout.html . See the Technical Details section near the bottom of the page.

avatar image tigertrussell · Mar 17, 2015 at 01:19 PM 0
Share

Ah - thank you! I'll definitely check this out.

avatar image tigertrussell · Mar 17, 2015 at 01:20 PM 0
Share

Uh oh - first link is dead

Edit: also second link :\

Double edit: the periods are getting included in the links; you might want to edit it for future. Both links work fine with the periods removed :)

avatar image pfreese · Mar 17, 2015 at 05:48 PM 0
Share

Links fixed. Thanks for letting me know.

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

22 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

Related Questions

Passing through a GameObject/Function to a button's OnClick 1 Answer

How to stop non-rectangular buttons from overlapping? 4 Answers

Cancel a drag and drop movement 1 Answer

Unity UI: How to stop select event from propagating? 1 Answer

UI button dosent show function 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