I'm using storyboard and a TabBarNavigation Controller. The View Controller of the tabs are embedded in NavigationController. I didn't set the image of the first TabBarItem in the storyboard.
- The png files don't show up. Only a gray square is shown, so maybe the size needs to be changed.
- If I select the second tab the png file in the first tab will be shown in the correct size.
I couldn't figure that out with the documentation. How do I have to adjust the image or what do I have to do?
var tabBarItem1 : UITabBarItem
var image1 = UIImage(named: "feed.png")
var image2 = UIImage(named: "feed_chosen.png")
tabBarItem1 = tabBar.items[0] as UITabBarItem
tabBarItem1.title = "Feed"
image1.drawInRect(CGRect(x: 0, y: 0, width: 40, height: 30))
tabBarItem1.image = image1
tabBarItem1.selectedImage = image2