IPhone : Converting iPad app to iPhone - xib size issue

on Wednesday, February 25, 2015

I'm trying to implement iPad app in iPhone, The steps i followed are



  1. Copied the existing .xib of first view controller and renamed it to name_iPhone.xib


  2. Enabled size class and auto layouts for name_iPhone.xib




  3. Kept the size for view as Inferred




Now i am printing the screen width(self.view.frame) in log.



NSLog(@"View Frame : %@",NSStringFromCGRect(self.view.frame));


The result is



View frame : {{0, 0}, {600, 600}} //this is the results regardless of any device i run


Actually the log should print the device(in which i am running the app) dimensions, But it always prints 600*600 regardless of device in which app is running. How to automatically resize the root view of a controller according to device dimensions. Please help me finding the solution.


0 comments:

Post a Comment