Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Ui Tookit - Tab and TabView code example

Discussion in '2023.2 Beta' started by jGate99, Aug 3, 2023.

  1. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,963
    Hi there,

    I noticed Tab and TabView in Beta version.
    Is there any code example or documentaiton to use it?

    Thanks

    upload_2023-8-3_16-12-20.png
     
  2. Jonathan-Westfall-8Bits

    Jonathan-Westfall-8Bits

    Joined:
    Sep 17, 2013
    Posts:
    290
    I attached a picture to possibly help out.

    You have a Tab View be the container of the tabs themselves.
    The Tabs act as the container for the content you want in the actual Tab.
     

    Attached Files:

    jGate99 likes this.
  3. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,963
    Thanks appreciate that :)
     
  4. Jonathan-Westfall-8Bits

    Jonathan-Westfall-8Bits

    Joined:
    Sep 17, 2013
    Posts:
    290
    No problem at all.

    Are you needing code examples with this or are you okay with just the UI Builder pic?
    If you need code examples are you wanting pure C# based, a mix of C#/UI builder, or are you curious about how to handle the UXML with the new properties bag?

    I might be able to whip something up for you now that the API won't be changing a lot since we are out of Alpha for 2023.2.
     
    jGate99 likes this.
  5. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,963
    Im actually using uxml approach, and it worked well.
    Really appreciate :)
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,403
  7. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,963
    karl_jones likes this.
  8. pzolla

    pzolla

    Joined:
    Apr 21, 2020
    Posts:
    19
    Can Tab View be configured to do vertical tabs?
     
  9. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    484
    Hi @pzolla!

    Yes, to get started on vertical tabs, you can do something like:
    Code (CSharp):
    1. .unity-tab-view {
    2.     flex-direction: row;
    3. }
    4.  
    5. .unity-tab-view__header-container {
    6.     flex-direction: column;
    7. }
    8.  
    9. .unity-tab__header-underline {
    10.     height: 100%;
    11.     width: 2px;
    12. }
    13.  
    Hope this helps!
     
  10. GameJing

    GameJing

    Joined:
    Nov 16, 2013
    Posts:
    3
    var tab_1 = new Tab("Tab1",TabIconImage_1); How to modify the size of TabIconImage_1 in TabView?
     
  11. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    497
    How to place anything into tabview???
    upload_2024-4-24_15-40-43.png
     
  12. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    497
    Ok, figured out that I need to hover over tabview not tabview-content-container.