假设我想授予用户在 iPad 中旋转的权限。 iPhone 没有旋转方案,因此我不需要提供此 iPhone 设置选项。
最佳答案
要检查设备是否为 iPad,您可以这样做:
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
//Setting for iPad
}
else {
//Setting for iPhone
}
同样你也可以这样做:
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
//Setting for iPhone
}
else {
//Setting for iPad
}
关于ios - 我们可以为 iPad 而不是 iPhone 显示 Settings.bundle 设置吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22679088/