I am working on a landscape view iPhone application. I rotate the view, then add another view inside it, which I call "horizontalView" in the code below. After adding this, I re-center it to the middle. This works fine to re-center correctly, but the trouble is that, my buttons in the mainView starts not working.
// Add the horizontal controller
HorizontalContainerViewController* c = [[HorizontalContainerViewController alloc]
initWithNibName:@"HorizontalContainerViewController"
bundle:nil];
self.horizontalView = [c view];
self.horizontalView.center = CGPointMake(160, 240); // <---- PROBLEM HERE
[containerView addSubview:horizontalView];
// Initially show the main view
self.mainViewController = [MainViewController createFor: self];
[self.horizontalView addSubView:self.mainViewController];
If I remove the line marked "PROBLEM HERE", my buttons inside mainViewController.view work fine. If I add this one line, they start not responding to my touch. What might be going on here?
EDIT: By the way... I noticed that some buttons closer to the edge of the view don't work, whereas some buttons in the middle of the view are working just fine.
Thanks,
-Steve