user976525
user976525

Reputation:

Rotation landscape and Portrait

I have problem in rotation in UIView, In UIView I have UIimage and UI toolbar when I change different rotation then UIImage and UIToolBar should also be changed

Upvotes: 0

Views: 174

Answers (2)

Marios
Marios

Reputation: 509

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

http://goodliffe.blogspot.com/2009/12/iphone-forcing-uiview-to-reorientate.html

check this site for more detail.

Upvotes: 0

CalZone
CalZone

Reputation: 1721

for iOS 6, In your view controller do this,

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

- (BOOL)shouldAutorotate {
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait
         | UIInterfaceOrientationMaskPortraitUpsideDown
         | UIInterfaceOrientationLandscapeLeft;
}

This will make orientation for Portrait, upside-down portrait and landscape left.

Upvotes: 1

Related Questions