Max Adamyan
Max Adamyan

Reputation: 177

iOS AutoLayouts, wrong UIView frame

I have an xib file and I want my green UIView to change its height according to Device, but whenever I want to get it height with methods

[self.tablePlaceView frame]; [self.tablePlaceView bounds];

it returns {{0, 0}, {320, 568}} on all Devices, but on previews and device it does everything right.

http://imageshack.com/a/img673/1600/zyMVoV.png

Upvotes: 0

Views: 446

Answers (1)

yonivav
yonivav

Reputation: 1033

by default your view get its size from your NIB file. after constraints take action, you'll be able to see the real frame in viewDidAppear: method

Upvotes: 1

Related Questions