iPad 方向问题 - 一个方向或全部四个方向 - 不能只让两个方向工作
我有一个 iPad 应用程序,我绝对需要横向显示,我知道建议的情况,但对于这个应用程序,它需要横向显示。
现在这是我的问题。
我已经编辑了我的 .plist 文件,以适当的方式支持横向左和横向右,并将自动旋转片段放入我的代码中,但是如果我有这个
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
/*if (autorotateOrientation && tapViewOrientation != interfaceOrientation && !insecureKeyboardWarningDialog) {
tapViewOrientation = interfaceOrientation;
[[NSUserDefaults standardUserDefaults] setInteger:tapViewOrientation forKey:kDefaultKeyTapViewOrientation];
*/
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
[self prepareTapView];
// return NO; ,
我就只剩下风景了(显然)
如果我有这个
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
/*if (autorotateOrientation && tapViewOrientation != interfaceOrientation && !insecureKeyboardWarningDialog) {
tapViewOrientation = interfaceOrientation;
[[NSUserDefaults standardUserDefaults] setInteger:tapViewOrientation forKey:kDefaultKeyTapViewOrientation];
*/
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight);
[self prepareTapView];
// return NO; 我得到了所有四个方向
。现在我可以提出一个纵向选项,但说实话,它会很丑而且不起作用,因此我希望仅在这种特定情况下为横向工作。
谁能建议我做错了什么以及如何将自己限制为仅景观,但两种形式的景观?
I've got an iPad app that I absolutely need to have in just landscape, I know the situation on the suggestions but for this app it needs to be landscape.
Now here's my problem.
I have editted my .plist file to support both landscape left and landscape right in the appropriate manner and have put an autorotate snippet into my code, however if I have this
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
/*if (autorotateOrientation && tapViewOrientation != interfaceOrientation && !insecureKeyboardWarningDialog) {
tapViewOrientation = interfaceOrientation;
[[NSUserDefaults standardUserDefaults] setInteger:tapViewOrientation forKey:kDefaultKeyTapViewOrientation];
*/
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
[self prepareTapView];
// return NO;
}
I get only landscape left (obviously)
if I have this
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
/*if (autorotateOrientation && tapViewOrientation != interfaceOrientation && !insecureKeyboardWarningDialog) {
tapViewOrientation = interfaceOrientation;
[[NSUserDefaults standardUserDefaults] setInteger:tapViewOrientation forKey:kDefaultKeyTapViewOrientation];
*/
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight);
[self prepareTapView];
// return NO;
}
I get all four orientations. Now I could just come upw tih an option for the portrait orientations however truth be told it would be ugly and non functional hence my desire to work for landscape only in this particular instance.
Can anyone suggest what I'm doing wrong and how to limit myself to landscape only, but both forms of landscape?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)