2015-10-01 56 views
0

當設備處於縱向方向時,我在viewController中使用了tableView和graphView。當我更改爲橫向模式時,我只想顯示graphView。我正在使用大小類來做到這一點。它適用於所有iPhone手機。在縱向和橫向模式下爲iPad設置不同約束

但是對於iPad,縱向和橫向的尺寸類是相同的(常規寬度和高度)。

我需要爲縱向和橫向模式設置不同的約束條件。如何在設備處於橫向時移除tableView。

回答

1

此代碼可以幫助你:

- (void) handleOrientation:(UIInterfaceOrientation) orientation 
{ 

    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) 
    { 
     //handle the portrait view 
    } 
    else if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) 
    { 
     //handle the landscape view 
     //write your code for removing Table 
    } 
} 
+0

約束是通過分鏡處理又是什麼呢? –

相關問題