对于这个愚蠢的问题,我很抱歉,但是我还没有找到一个好的答案。
如果我勾选UIUserInterfaceIdiomPhone,iPhone和iPod touch都会得到YES?
我的意思是:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
return YES;
}是否仅为iPad返回YES,为iPhone和iPod都返回portrait?
我开发了一个iPhone应用程序,现在我正在将其更改为通用的。它就快完成了,我不想改变我所有的“如果”。(我没有真正的iPod触摸来亲自测试它)。
谢谢,麦克斯
发布于 2012-08-31 23:07:21
是的,在这一点上,iPod touch被处理为iPhone。
发布于 2012-08-31 23:18:06
此宏主要用于区分iPad和iPhone或iPod的屏幕大小。
由于iPhone和iPod具有相同的屏幕尺寸,因此都属于手机类别。因此,对于iPhone和iPod,UIUserInterfaceIdiomPhone是YES
是iPad的NO。
有关更多信息,请阅读apple docs。
https://stackoverflow.com/questions/12217997
复制相似问题