2015-10-01 54 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

约束是通过分镜处理又是什么呢? –

相关问题