I recently updated my iPhone only app to an universal app and successfully submitted the update to the appstore. however, the UI-Designers behind 开发者_JAVA技巧the project would like to have individual status bar styles for each app. So the iPhone UI should have a solid black status bar where the iPad implementation should have it semi-transparent.
is there a way to tweak key/value-pairs in the info.plis file to achieve something like this?
thanks a lot for your ideas, sam
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// The device is an iPad running iOS 3.2 or later.
}
is recommended way of testing the device is iPad for iOS SDK >= 3.2
Use UIDevice
class to get device model type in your application
NSString* deviceType= [[UIDevice currentDevice] model];
NSString* iPad = [NSString stringWithString:@"iPad"];
Now set the style of your status bar as per the model.
if([iPad compare:[deviceType substringWithRange:NSMakeRange(0,[iPad length])]] == NSOrderedSame )
{
//This is iPad
}
else
{
//This is iPhone/iPod
}
精彩评论