Weird behavior of UIView frame after rotation in iPhone

前端 未结 1 2023
悲哀的现实
悲哀的现实 2020-12-15 06:17

Create a square UIView object testView_, and add this at viewDidLoad:

- (void)viewDidLoad {
[super viewDidLoad];
CGRect initialRect = testView_.frame;
NSLog(         


        
相关标签:
1条回答
  • 2020-12-15 07:00

    In UIView Class Reference you can see here that you should not set the frame of a view with transform property different than CGAffineTransformIdentity.

    If you want to change the position of the transformed view, you should use center property. If you want to adjust the size you should use bounds property.

    0 讨论(0)
提交回复
热议问题