Peter Kazazes
Peter Kazazes

Reputation: 3628

UIView rotation text manipulation

I have a view that consists of a bunch of UILabels. As of right now the view is only configured to work when the device's orientation is portrait, however I would like to make it so that when the device is rotated one specific UILabel's location is changed and text size is magnified. When the device's orientation is reverted to portrait, I'd like for it to return to its original state.

How should I go about doing this?

Upvotes: 0

Views: 110

Answers (1)

quaertym
quaertym

Reputation: 3961

Implement this method in your ViewController and do the changes accordingly.

   - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{

      if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {
        // do something in landscape orientation
      } else {
        // do something in portrait orientation
      }

   }

Upvotes: 2

Related Questions