user83950
user83950

Reputation:

how to open a landscape view from a portrait view

I have a portrait view showing a library of images, clicking on an image should open it in landscape view for editing. Now I know I could manually rotate the new view 90 degrees to make it “look” like it is in landscape but isn’t there a proper solution? e.g. somehow I could force the device to go into landscape mode?

Upvotes: 0

Views: 782

Answers (3)

user83950
user83950

Reputation:

tuns out I'll have to manually rotate my views or at least my findings suggest so. So here's what I am doing now:

  • Show the first view in Portrait Mode.
  • When user goes to the next view, I manually apply a transform to it to rotate it PI/2 radians and set its frame and center properties.

Upvotes: 1

learner2010
learner2010

Reputation: 4167

To force the device to go to landscape mode, you can add

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

Adding this to the view you want to display in landscape should make the view come in landscape mode...

Upvotes: 0

Andrew Ebling
Andrew Ebling

Reputation: 10283

Push a modal view controller which is configured to only support landscape mode.

Upvotes: 0

Related Questions