2011-04-26 54 views
0

我有一個UIView包含在iPad應用程序中的tableview。當設備旋轉時,我在navController上推另一個視圖。當設備向後旋轉時,我彈出navController的頂視圖。然而,出於某種原因,每次發生這種情況時,第一個視圖中的UITableView會更大,並且會覆蓋其他一些內容。任何想法爲什麼發生這種情況?我很茫然。謝謝!爲什麼我的UITableView改變其大小?

回答

0

我把我的tableView在我的第一視圖(對不起,這聽起來令人困惑)內的子視圖,由於某種原因,現在,當我彈出navController時,表保持相同的大小。一切都好!

1

在navigationcotroller WHR的UITableView的根源所在,我寫了這個功能

-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation: 
(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration 
{ 
    UIInterfaceOrientation orient=self.interfaceOrientation; 
    if (orient==UIInterfaceOrientationLandscapeLeft || orient==UIInterfaceOrientationLandscapeRight) 
    { 
     viewtwo *two=[[viewtwo alloc] initWithNibName:@"viewtwo" bundle:nil]; 
     [self.navigationController pushViewController:two animated:YES]; 

    } 
     [UIView commitAnimations]; 

} 

和viewtow視圖 - 控制我寫了這個功能彈出窗口,導航

-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation: 
(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration 
{ 
    UIInterfaceOrientation orient=self.interfaceOrientation; 
    [UIView beginAnimations:@"move Button" context:nil]; 
    if (orient==UIInterfaceOrientationPortrait || orient==UIInterfaceOrientationPortraitUpsideDown) 
    { 
     [self.navigationController popViewControllerAnimated:YES];  
    } 
    [UIView commitAnimations]; 

} 

,那是沒問題,我的意思的UITableView大小和以前一樣。

+0

我敢打賭,這也可以!現在我發現了一個復飛,我現在有點緊張要改變任何事情。雖然謝謝! – Rossi 2011-04-27 22:20:32

0

檢查Interface Builder中的自動調整大小掩碼,或在代碼中設置它們。

相關問題