【问题标题】:how to change my code into landscape orientation?如何将我的代码更改为横向?
【发布时间】:2012-06-20 08:29:25
【问题描述】:

我写了一些显示下拉列表的代码,但是下面的代码在我使用时不起作用:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{}

在 iPad 上。

有人知道我可以如何解决这个问题吗?

我的代码:

- (void)dropDownCellSelected:(NSInteger)returnIndex{
    [button setTitle:[arrayData objectAtIndex:returnIndex] forState:UIControlStateNormal];
}   


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    if (UIInterfaceOrientationIsLandscape(interfaceOrientation)){
        return YES;
    } else {
        return NO;
    }
}

帮我解决 iPhone 上的问题。

【问题讨论】:

    标签: iphone ipad ios5 screen-orientation


    【解决方案1】:
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多