In my
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
method, I have code to reposition and resize a scrollview as the app rotates with the device. I do it with the following code:
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:0.5f];
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight){
//landscape
[mT.buttonScroll setFrame:CGRectMake(0, 544, 1024, 160)];
}else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft){
//landscape
[mT.buttonScroll setFrame:CGRectMake(0, 544, 1024, 160)];
}else if (toInterfaceOrientation == UIInterfaceOrientationPortrait){
//portrait
[mT.buttonScroll setFrame:CGRectMake(0, 800, 768, 160)];
}else if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
//portrait
[mT.buttonScroll setFrame:CGRectMake(0, 800, 768, 160)];
}
}
Everything rotates properly, but once I rotate a second time the scroll view becomes completely untouchable. Cannot scroll it or touch any of the buttons in it. Then if I rotate back to the previous view the touch comes back and so on. Does anyone know why it is doing this?