Search code examples
iosios7uitabbarcontrolleruisplitviewcontrolleruitabbaritem

UITabBarItem invisible in iOS 7 with UISplitViewController


I have a little problem easily reproductible with Xcode 6.1.1 :

  • Create a new Tabbed application project
  • Set the deployment target to iOS 7
  • Go into the storyboard and drag and drop a UISplitViewController
  • Link it to the UITabBarController
  • Edit the new Tab Bar Item, set an image and set its name

Now run the project in the simulator (iPhone) for iOS 7 and iOS 8. The Tab bar item is invisible in iOS 7 whereas its visible in iOS 8...

This is on iOS 8 This is on iOS 7

Any thoughts to make it visible?

PS: I've already checked Issue with Split View Controller with UITabbarController in iOS7 and UISplitView with UITabbar but none is about the invisible item...


Solution

  • UISplitViewController doesn't exist on iPhone ios7 ...

    if you still would like to use it as root controller, check this http://op183.github.io/MasterDetailDemo/

    override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view.
            let barItems: [UITabBarItem] = tabBar.items as [UITabBarItem]
            for bar in barItems {
                println(bar.selectedImage)
                println(bar.title)
            }
        }
    

    and the result is ....

    <UIImage: 0x7a742ca0>
    Optional("First")
    <UIImage: 0x7a744800>
    Optional("Second")
    nil
    nil
    

    as a workaround try set the right values there

    if bar.title == nil {
                    bar.title = "TITLE"
                }
    

    works for me

    1) it is hard to say, what is wrong with storyboard, but even if title and images are set to nil, the 'connection' still works