查看仅在iPhone未显示在iPad上了 [英] View not showing up in iPad only in iPhone

查看:179
本文介绍了查看仅在iPhone未显示在iPad上了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的应用程序,其中使用故事板创建的UI。我有一个图标和登录按钮登录屏幕。它显示出来,当我在iPhone上运行,但在iPad上。无论是在模拟器和设备。

要检查它是否是因为我的关系,我只是下降了一个标签,没有任何约束和视图与蓝色背景。即使这些都没有显示出来。构建设置有部署信息 - >设备设置为通用。

什么是错的任何指针将大大AP preciated。

修改

我尝试以下。在我的应用程序,成功登录后,进入用户界面选项卡视图控制器。如果我禁用登录屏幕的显示,应用程序正进入标签视图控制器,并在iPad上正确显示它。我不知道为什么登录屏幕没有显示在iPad上了。

编辑添加的伊斯兰教要求细节

code

AppDelegate中,检查用户登录。如果没有,显示登录屏幕否则显示TabViewOCntrolelr。该TabViewCOntroller部分是显示在iPad和iPhone了。

 如果([GIDSignIn sharedInstance] .currentUser.authentication ==无)
{
    UIStoryboard *分镜= [UIStoryboard storyboardWithName:@主捆绑:无];
LoginViewController *的viewController =(LoginViewController *)[故事板instantiateViewControllerWithIdentifier:@loginScreen];[self.window makeKeyAndVisible]
[self.window.rootViewController presentViewController:的viewController
                                             动画:NO
                                           完成:无];
}
其他
{
    如果(![self.gotUser preFS isEqualToNumber:@(YES)])
    {
        UIUserNotificationType类型= UIUserNotificationTypeBadge |
        UIUserNotificationTypeSound | UIUserNotificationTypeAlert;        self.mySettings = [UIUserNotificationSettings settingsForTypes:类型类别:无];
    }    [UIApplication的sharedApplication] registerUserNotificationSettings:self.mySettings];
    [应用registerForRemoteNotifications]
    //要不要添加沉默登录逻辑
}

的ViewController code确实没有什么花哨。只是显示视图,当用户点击谷歌签到按钮,完成登录,它将通过志愿被通知登录已完成。在这一点,它调用[自我dismissViewControllerAnimated:YES完成:无];解雇本身和标签视图控制器将显示

我附上屏幕截图的https://drive.google.com/folderview?id=0B1PZ4somNxNtNGkzZzY2cXYwU1U&usp=sharing


1. Main.Storyboard与iPhone和iPad显示,iPad的显示什么而iPhone显示视图preVIEW屏幕

<醇开始=2>
  • 与相关的ViewController各种菜单设置


  • 如何在模拟器登录屏幕显示出来



  • 解决方案

    看来你加入温妮HANY模式不是你的看法(底部在你的故事板)。如果添加在wRegular hRegular你的意见(例如)模式下,您只能看到在iPad上你的看法。和副诗句。检查你的观点,在属性检查器的底部,你可能看到这样的事情

    在这里输入的形象描述

    要解决这个问题,你可以检查安装键,您的视图将在所有尺寸的类进行安装。

    阅读教程,这是开始的好地方。

    I have a simple app where the UI is created using storyboard. I have a login screen with an icon and a login button. It is showing up when I run on iPhone, but on iPad. Both in simulator and on device.

    To check if it was due to my constraints, I just dropped one label without any constraints and view with blue background. Even these are not showing up. Build settings has Deployment Info --> Devices set to Universal.

    Any pointers to what is wrong will be greatly appreciated.

    EDIT

    I tried the following. In my app, after successful login, UI enters a tab-view controller. If I disable the showing of login screen, the app is entering the tab view controller and displaying it properly on the iPad too. I have no idea why the login screen is not showing up on the iPad.

    EDIT to add details requested by Islam

    Code

    AppDelegate, checks if user is logged in. If no, shows the login screen else shows the TabViewOCntrolelr. The TabViewCOntroller part is showing up on the iPad and iPhone

    if([GIDSignIn sharedInstance].currentUser.authentication == nil)
    {
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    LoginViewController *viewController = (LoginViewController *)[storyboard instantiateViewControllerWithIdentifier:@"loginScreen"];
    
    [self.window makeKeyAndVisible];
    [self.window.rootViewController presentViewController:viewController
                                                 animated:NO
                                               completion:nil];
    }
    else
    {
        if(![self.gotUserprefs isEqualToNumber:@(YES)])
        {
            UIUserNotificationType types = UIUserNotificationTypeBadge |
            UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
    
            self.mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
        }
    
        [[UIApplication sharedApplication] registerUserNotificationSettings:self.mySettings];
        [application registerForRemoteNotifications];
        //To Do add silent sign-in logic
    }
    

    ViewCOntroller code does nothing fancy. Just displays the view, when user clicks Google Sign-in button and completes the login, it will be notified through KVO that login has completed. At which point, it calls [self dismissViewControllerAnimated:YES completion:nil]; to dismiss itself and tab view controller will be shown

    I have attached screen shots to https://drive.google.com/folderview?id=0B1PZ4somNxNtNGkzZzY2cXYwU1U&usp=sharing

    with 1. Main.Storyboard and Preview screen of iPhone and iPad showing that iPad shows nothing while iPhone shows the view

    1. Settings of various menus associated with ViewController

    2. How the login screen shows up in the simulator

    解决方案

    It seems that you add your views not in wAny hAny mode (bottom side in your storyboard). If you add your views in wRegular hRegular (for example) mode you will see your views only on iPads. And vice-verse. Check your view, On bottom of Attributes inspector you probably see something like this

    To solve this you can check Installed and your view will be installed on all size classes.

    Read this tutorial, it is good place to start.

    这篇关于查看仅在iPhone未显示在iPad上了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆