gpt4 book ai didi

ios - 我们可以为 iPad 而不是 iPhone 显示 Settings.bundle 设置吗?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:07:33 27 4
gpt4 key购买 nike

假设我想授予用户在 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com