[英]Xcode 1) Start and stay in landscape mode with swipe gesture 2) Play audio sound when image is tapped
I'm fairly new at programming and using Xcode for iPhone App design. 我在编程和使用Xcode进行iPhone App设计方面还很陌生。 I wish to do the following: 我希望执行以下操作:
My problem is this: 我的问题是这样的:
even when starting in landscape mode, and after a swipe, the iphone simulator rotates to portrait mode. 即使以横向模式启动并滑动后,iphone模拟器也会旋转至纵向模式。
Any advice or comment is greatly appreciated. 任何建议或意见,不胜感激。
You have to define in shouldAutorotateToInterfaceOrientation: which modes you support. 您必须在shouldAutorotateToInterfaceOrientation:中定义您支持的模式。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
will handle both landscape modes. 将处理两种风景模式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.