Nik*_*anf 4 uitabbarcontroller uitabbaritem uitabbar ios
各位,我正在尝试自定义UITabBar,但问题是当我在UITabBar.background中设置简单的绿色背景颜色时,结果不足.就像背景上的东西一样.这里看起来像:

UITabBarController是在storyboard中创建的,但我在代码中设置了背景颜色.这是appDelegate:
TabBarController* bc=(TabBarController*)self.window.rootViewController;
bc.tabBar.backgroundColor=[UIColor greenColor];
Run Code Online (Sandbox Code Playgroud)
如果我在背景和物品上设置图片 - 它们几乎看不见.我试过在故事板的右边栏上玩色彩,但都没用.
小智 12
我在iOS 8中以编程方式创建UITabBarController背景颜色时遇到了类似的问题.问题是当我应该使用barTintColor时我使用的是backgroundColor.试试这个.
TabBarController* bc=(TabBarController*)self.window.rootViewController;
bc.tabBar.barTintColor=[UIColor greenColor];
Run Code Online (Sandbox Code Playgroud)
如果这对您有用,请告诉我.
| 归档时间: |
|
| 查看次数: |
4419 次 |
| 最近记录: |