Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

self.view setFrame not working with iOS 8 and Nav Controller

Tags:

ios

ios8

Has anyone noticed that self.view setFrame has stopped working with Nav Controller in iOS 8. It works just fine if the view controller does not have a nav controller, but otherwise, it doesnt. Does anyone know a work around? Currently I am using

[self.view setFrame:CGRectMake(0,-100,[[UIScreen mainScreen] bounds].size.width,[[UIScreen mainScreen] bounds].size.height)];

But this doesnt work anymore

like image 784
Jonathan Avatar asked Sep 18 '14 07:09

Jonathan


Video Answer


1 Answers

Try to set "setTranslatesAutoresizingMaskIntoConstraints" to YES before setting the frame:

[self.view setTranslatesAutoresizingMaskIntoConstraints:YES];

And then set your frame:

[self.view setFrame:CGRectMake(0,-100,[[UIScreen mainScreen] bounds].size.width,[[UIScreen mainScreen] bounds].size.height)];
like image 80
Sergio Avatar answered Oct 19 '22 16:10

Sergio