开发者

View is not rotating with respect to the device orientation,in my iPhone app

In my iPhone app, I have the following code to rotate the Views with respect to the device orientation.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations

    return YES;
}

When the device is rotated to landscape mode the view is not rotating.

I have tried return (interfaceOrientation == UIDeviceOrientationLandscapeLeft);

It didn't work, how can I do this? 开发者_如何学运维That class contains one searchbar, table view like this

View is not rotating with respect to the device orientation,in my iPhone app

thanx in advance


I think the reason should be the below issue:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations

    return YES;
}


"You should write return YES; in every viewController in your Application. Even in one class if you write return No;  it will not work obviously..."
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜