我已通过此代码阻止了界面方向。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
if (orientation == UIDeviceOrientationPortrait) {
NSLog(@"portrait");
}else{
NSLog(@"landsape");
}
return NO;
}
我正在使用弹出框指向向上的按钮。
[popoverController presentPopoverFromRect:[button bounds] inView:button allowedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
肖像模式是正确的。我的问题是如何相对于屏幕的纵向模式始终向上显示弹出框?如果有人有任何想法,请帮助...在此先感谢。