Since i installed Xcode 8, i am in trouble. I didnt get the correct value for each or any UIView.
I also got the constraint alert for UIView. So i update it. But view returns 1000 as width or height. I tried or search a lot. But didnt got any proper solution. pls help me.
As mentioned here, you should call layoutIfNeeded
for your view in viewDidLoad
:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.view layoutIfNeeded];
// Now all your subviews are sized as you expect
}
For Swift 3 :
override func viewDidLoad() {
super.viewDidLoad()
self.view.layoutIfNeeded()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With