2016-07-11 16 views

答えて

0

あなたは、あなたのようなtabbarcontrollerのあなたの最初のViewControllerで

 NSArray *arr = self.tabBarController.tabBar.subviews; 
NSLog(@"tabbar subview : %@",arr); 

UIButton *button = (UIButton*)[arr objectAtIndex:3]; 
button.backgroundColor = [UIColor greenColor]; 

を試すことができます...

// Add background color to middle tabBarItem 
let itemIndex = 2 
let bgColor = UIColor(red: 0.08, green: 0.726, blue: 0.702, alpha: 1.0) 

let itemWidth = tabBar.frame.width/CGFloat(tabBar.items!.count) 
let bgView = UIView(frame: CGRectMake(itemWidth * itemIndex, 0, itemWidth, tabBar.frame.height)) 
bgView.backgroundColor = bgColor 
tabBar.insertSubview(bgView, atIndex: 0) 
0

これを確認してください。

関連する問題