ios - iPad landscape showing portrait frame and bounds -


i developing ipad landscape app using storyboard. have done below steps same. app screen opening in landscape on simulator.. getting wrong frame.

  1. sample app template xcode storyboard.
  2. allow landscape orientation info-plist file
  3. storyboard -> uiviewcontroller -> simulated matrices -> changed orientation landscape
  4. implemented below method in view controller.m

           - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation     {      // return yes supported orientations    return ((interfaceorientation == uiinterfaceorientationlandscapeleft) || (interfaceorientation == uiinterfaceorientationlandscaperight));          }  

now when take nslog of frame , bounds show me portrait frame.

   - (void)viewdidload   {     [super viewdidload];     // additional setup after loading view, typically nib.     nslog(@"bounds ::%@",nsstringfromcgrect(self.view.bounds));     nslog(@"frame ::%@",nsstringfromcgrect(self.view.frame));    } 

result log :

   bounds ::{{0, 0}, {748, 1024}}     frame ::{{20, 0}, {748, 1024}} 

am missing ?

in viewdidload method dont correct bounds. in viewdidappear method. viewdidappear method called when view loaded , has correct bounds.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -