0
votes

My application contains a Tab Bar Controller and Navigation controller. Its totally in Portrait mode. Now I have a table view in 2nd tab, clicking on each row of table view will push another view controller which will show a graphical chart, now I want this chart to be in landscape mode where as the rest of application is in portrait mode.

I came to know that we have to rotate the view on our own, now my question is how to rotate this new view in landscape mode. I put some UIView animations in viewWillAppear function, but I want the block-based animation to rotate this view to landscape for me and when I go back it rotate back portrait mode.

Thanks in advance !

1
Please refer to [Previous Post][1] which may help you to get solution. [1]: stackoverflow.com/questions/6813899/…DShah

1 Answers

1
votes

Check the device orientation and make the rotation depends on it:

[UIView animateWithDuration:0.5f animations:^{ myView.transform = CGAffineTransformMakeRotation(-M_PI * 0.5); } ];