後滾動或交互作用。在我的UIScrollView不會讓旋轉
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
方法,我有一些代碼來重新定位和應用程序與設備旋轉調整滾動型。我用下面的代碼:
-(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)];
}
}
一切正常旋轉,但一旦我第二次旋轉滾動視圖變得完全不可觸摸。無法滾動或觸摸其中的任何按鈕。然後,如果我旋轉回到先前的視圖,觸摸回來等等。有誰知道它爲什麼這樣做?
你是否更新滾動視圖的內容大小? –