错误的方向 [英] Getting wrong orientation

查看:76
本文介绍了错误的方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的申请中遇到了一个让我发疯的问题。在我的应用程序中,我将模拟器旋转到横向模式,但在我的下面功能中,我得到纵向方向。

I am having an issue in my application which drives me mad. In my application, I rotate the simulator to the landscape mode, but in my below function, I get portrait orientation.

这里有什么问题?请帮帮我。

What is the problem here? Please help me out.

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
  if ( interfaceOrientation == UIInterfaceOrientationPortrait || 
  interfaceOrientation ==    UIInterfaceOrientationPortraitUpsideDown )
  {
    NSLog(@" portrait orientation");
  }
  else
  {
    NSLog(@"Landscape"); 
  }
 return YES;
}


推荐答案

该方法返回BOOL,你必须返回YES或NO

The method returns BOOL, you have to return either YES or NO

这篇关于错误的方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆