Is it possible to make a scrolling tab bar for a Tab-Based Application?

Discussion in 'iOS Development' started by -Xi-, Aug 24, 2009.

  1. -Xi-

    -Xi- Banned

    Joined:
    Apr 3, 2009
    Messages:
    286
    Likes Received:
    0
    Device:
    iPod touch
    Now, the default tab bar is fine and all, but if you want more than, say, five tabs, it starts getting fairly crowded.

    Is there a way to make a scrolling tab bar for a Tab-Based App? For example, you have five tabs, with an arrow on each side. Pressing one of them will display five different tabs, pressing the opposite arrow will take you back to the initial five.

    Is this possible in a tab-based app?
  2. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    Not by default. You could write you own.

    However, if it gets to that point, maybe you want to look into other, more out-of-the box UI solutions.

    EDIT: "default" meaning anything made by Apple for public use.
  3. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    You could try making something similar to the current Facebook applications.
    But as Axis said, you'd have to make it yourself.
  4. hacx

    hacx New Member

    Joined:
    Oct 21, 2008
    Messages:
    3
    Likes Received:
    0
    I Think you can make that pretty easily by using a UIScrollView and putting a TabBar inside it and settings the TabBar frame to the ScrollView content frame.
  5. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Anything's possible. However, HIG state that you should use a More controller and add your extra controllers in there.

    Furthermore, if you have that many possible tabs, maybe you should look into alternate UI, trimming the unnecessary, or simply ommiting some portions of the application.

    An example alternate UI.
    Why not imbed your UITabBarController into a UINavigationController, as seen in Tweetie and my NavToTab example project.

    When the user selects a tab, push another UITabBar controller of more specialized controllers onto the screen. You will need to override the tab bar's delegation methods for this to work, but it should be simple enough.

    Another example alternate UI.
    Part of the UITabBar API allows you to animate the removal/addition of tabs from the UITabBar. When the user selects a tab, animate some more view controllers, removing the unessential view controllers.

    Both of the above are hybrid UITabBar/UINavigationController functionality. And, while not ideal, should be easy enough for your user to figure out and understand because of their familiarity with the two objects and how they work.

    Ultimately, try to create a "better," more fluid layout.
  6. -Xi-

    -Xi- Banned

    Joined:
    Apr 3, 2009
    Messages:
    286
    Likes Received:
    0
    Device:
    iPod touch
    Thanks for the advice.

    I liked the tab-based layout because of the ease of use, and the ability to quickly change views with a single touch. However, for my project, I think I'd be better off going with a basic view with buttons to go to an alternate view.

    The end result, as you said, needs to be easy for the user to figure out. Sorting through a tab bar that's forced to be something that it's not is going to make that more difficult, which in turn will make the app less usable. Something like a straightforward button layout will remove the need for a tab bar and the non-ideal setup it would take to avoid the crowding.

    Thanks again everyone.

    Please Register or Log in to view images

Share This Page