2012-09-11 33 views
0

您好目前正在一個ipad應用程序,我需要顯示tableview。所以我們用自定義的單元格來顯示tableview。現在的問題是當應用程序處於橫向模式時,我的自定義單元格中有一個佈局,當應用程序旋轉到縱向模式時,佈局應該被更改。任何幫助將不勝感激。在不同的方向更改自定義的uitableviewcell內容的位置

回答

0

試試這個,

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 
    if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) { 
     //your code for landscape 
    } else { 
     //your code for portrait 
    } 
} 

這或許可以幫助你.....

+0

是的,我們嘗試過,但重裝tableview中的損耗會導致內容的權利。例如,如果我們旋轉並重新加載數據,那麼在點擊單元格上的按鈕以擴展單元格。 :( – ravoorinandan

相關問題