【发布时间】:2010-10-06 15:51:17
【问题描述】:
我的应用程序以横向模式运行,我希望它始终以一种形式运行,即假设背景是 stackoverflow 图片,在这种情况下,堆栈将位于耳机旁边,并在用户旋转时我想要的主页按钮旁边流动iphone 180 度(仍为横向模式) 现在流量将在耳机旁边并堆叠在主页按钮旁边注意:我需要所有视图旋转而不仅仅是背景
谢谢
【问题讨论】:
标签: iphone objective-c
我的应用程序以横向模式运行,我希望它始终以一种形式运行,即假设背景是 stackoverflow 图片,在这种情况下,堆栈将位于耳机旁边,并在用户旋转时我想要的主页按钮旁边流动iphone 180 度(仍为横向模式) 现在流量将在耳机旁边并堆叠在主页按钮旁边注意:我需要所有视图旋转而不仅仅是背景
谢谢
【问题讨论】:
标签: iphone objective-c
覆盖
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
在您的视图控制器中并为您想要支持的任何方向返回 YES。
例如:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((interfaceOrientation == UIInterfaceOrientationPortrait) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight))
}
除了倒置之外的所有方向都会返回 YES。
【讨论】: