繁体   English   中英

UIView旋转文本操作

[英]UIView rotation text manipulation

我有一个由一堆UILabel组成的视图。 截至目前,视图仅配置为在设备的方向为纵向时工作,但是我想这样做以便在旋转设备时更改一个特定的UILabel位置并放大文本大小。 当设备的方向恢复为肖像时,我希望它恢复到原始状态。

我该怎么做呢?

在ViewController中实现此方法并相应地执行更改。

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

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

   }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM