开发者

Black tab bar turns white when exporting from Xcode to iPhone

开发者 https://www.devze.com 2023-03-02 10:02 出处:网络
When running my app via the iPhone Simulator / Xcode, the tab bar color is black. However, when I moved the app onto my iPhone for testing, the tab bar turned white.I looked for someone with a similar

When running my app via the iPhone Simulator / Xcode, the tab bar color is black. However, when I moved the app onto my iPhone for testing, the tab bar turned white. I looked for someone with a similar experience via Google / Stack Overflow, but I couldn't find any answers.

Any suggestions?

EDIT - My Tab Bar icons have a clear background. As i mentioned before the color is black in the simulator, but white on my phone. Do i need to color in the开发者_Python百科 background of my icons?

EDIT 2 - I actually went into Interface Builder and found out that the tabbar default color was white. I still cant figure out why it showed up as black in the simulator but thanks for your help!


When running in the iPhone Simulator, you are only "simulating" the style of the device's status bar. The simulated setting for this can be found in the Interface Builder portion of Xcode 4 or in Interface Builder.app bundled with Xcode3 – look for the "Simulated Metrics" section of the Attributes inspector when you have your UIViewController selected.

Since the setting in Interface Builder only simulates the status bar style, you need to set it explicitly in your application code. This is done with the setStatusBarStyle:animated: method of the UIApplication class:

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque
                                            animated:NO];

See the UIApplication Class Reference page for more information.

0

精彩评论

暂无评论...
验证码 换一张
取 消