首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在纵向和横向模式下为iPad设置不同的约束

问在纵向和横向模式下为iPad设置不同的约束
EN

Stack Overflow用户
提问于 2015-10-01 19:51:13
回答 1查看 607关注 0票数 0

当设备处于纵向时,我在viewController中有tableView和graphView。当我切换到横向模式时,我只想显示graphView。我使用size类来做这件事。它适用于所有iPhones。

但对于iPad,纵向和横向的大小类是相同的(常规的宽度和高度)。

我需要为纵向和横向mode.How设置不同的约束,当设备处于横向时,我是否要删除tableView。

EN

回答 1

Stack Overflow用户

发布于 2015-10-01 20:50:52

此代码可能会对您有所帮助:

代码语言:javascript
复制
- (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
    }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32886934

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档