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
1
Question by rishabhvinod · Sep 03, 2013 at 06:39 AM ·

I just wanna display my data in list view but i am not finding the solution, in unity how can we create list view..???

I am using web service for showing data through an API my data is loading properly and showing in console but i need listview to show it on GUI. Please help and thanks in advance

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

3 Replies

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

Answer by phort99 · Sep 03, 2013 at 08:15 AM

There is no API for creating an iOS style list view. If you need a real iOS list view, you could use a native plugin. If you just want to display some information in a list with Unity's GUI, GUILayout is your friend. Create a scroll view, and add labels or buttons or whatever you need.

Here's some sample code:

 using UnityEngine;
 using System.Collections;
 
 public class listView : MonoBehaviour {
     
     Vector2 scrollPosition = Vector2.zero;
     
     void OnGUI () {
         string[] listItems = 
         {
             "Hello world,",
             "this",
             "is a",
             "very",
             "very",
             "very",
             "very",
             "very",
             "very",
             "long",
             "list.",
         };
         
         GUILayout.BeginArea(new Rect(0f, 0f, 300f, 200f), GUI.skin.window);
         scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, true); 
         GUILayout.BeginVertical(GUI.skin.box);
         
         foreach (string item in listItems)
         {
             GUILayout.Label(item, GUI.skin.box, GUILayout.ExpandWidth(true));
         }
         
         GUILayout.EndVertical();
         GUILayout.EndScrollView();
         GUILayout.EndArea();
     }
 }
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 rishabhvinod · Sep 03, 2013 at 08:51 AM 0
Share

@phort99: thanx for ur reply can u please explain with some example, actually i also tried GUILayout thing but not getting my solution.

avatar image phort99 · Sep 03, 2013 at 09:15 AM 0
Share

I added some sample code.

avatar image rishabhvinod · Sep 04, 2013 at 01:46 PM 0
Share

@phort99 thanks it helps me alot.. :)

avatar image Uchiha Itachi · Mar 20, 2014 at 02:47 AM 0
Share

Feel so fortunate, the fine answer here helped me a lot on solving the problem with listview control I am facing with. Since I am quite new in Unity and know nothing about listview, I read through a listview control tutorial but still got no idea. This question and its answer did me a great favor. But, still can't be clear with the native plug-in thing.

avatar image
0

Answer by ShargonXL · Nov 03, 2014 at 11:14 AM

its possible to generate this items dynamic... to make something like this:

  • http://pic002.cnblogs.com/images/2011/31770/2011060717220256.png

  • https://lh4.ggpht.com/bjwAAE72H5znXX8L3MgOGKMyOCVjc7DgyRQGPqLqSKrkbiAowtWKy98EbwgHefiW1wQ=h900

the items row Heiht, its different to header row....

Sorry for my english :(

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
0

Answer by GrantTheAnt · Nov 27, 2014 at 11:28 PM

Our product, "ListView for Unity UI", is a ListView control that uses the same code interface as the .NET control. Check it out here! http://u3d.as/content/endgame-studios/list-view-for-unity-ui/998

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

20 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

Related Questions

A node in a childnode? 1 Answer

Running a Unity 4.6 game on Unity 4.5.2 - Possible? 1 Answer

Error ambiguous reference with Json 1 Answer

I want to add progress bar in my application, can anyone explain with one example. 0 Answers

Game Crashes on iphone3gs and iPod touch but work fine on iPhone 4s 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