0

I have an app that is designed to start up in Landscape mode, this all works fine. I add an imageview to cover the screen and then add a scrollview halfway down. Again all works fine.

I then add a series of uiimageviews again all fine. I notice if i try to click the far right image there is no response but the other images preceding this work fine. With lots of digging around I discovered the viewcontroller keep portrait coordinates. I have a tabbar at the bottom when I click to go to another view and then go back to the main view the far right uiimageview not works. Has anyone seen this before? I am guessing the view is redrawing itself when it comes back?

rmaddy
  • 314,917
  • 42
  • 532
  • 579

2 Answers2

0

You should use .bounds property instead of the .frame property of the view. Bounds honor the UIVIew's coordinate system. It's well explained in this answer: https://stackoverflow.com/a/8181113/402223

Community
  • 1
  • 1
Martijn
  • 460
  • 4
  • 16
0

See this article which answered my question here

- (void)viewDidLayoutSubviews
{
    // fix for iOS7 bug in UITabBarController
    self.selectedViewController.view.superview.frame = self.view.bounds;
}

note don't add it to viewdidload method.

Thanks Martijn you put me on the right track.

Community
  • 1
  • 1