当设备处于纵向时,我在viewController中有tableView和graphView。当我切换到横向模式时,我只想显示graphView。我使用size类来做这件事。它适用于所有iPhones。
但对于iPad,纵向和横向的大小类是相同的(常规的宽度和高度)。
我需要为纵向和横向mode.How设置不同的约束,当设备处于横向时,我是否要删除tableView。
发布于 2015-10-01 20:50:52
此代码可能会对您有所帮助:
- (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
}
}https://stackoverflow.com/questions/32886934
复制相似问题