Where to get frame size of custom UIView in its subclass

后端 未结 3 1535
一整个雨季
一整个雨季 2021-02-05 11:24

When does the correct frame size of the UIView is calculated when I add my custom UIView by using storyboard? I can\'t get correct frame size in UIView\'s

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 12:03

    You should have an IBOutlet to your UIView and in the viewDidLayoutSubviews() method, get the size by yourViewOutlet.frame.size.

提交回复
热议问题