显示根视图控制器后出现黑屏,仅当继承PayPalPaymentDelegate时 [英] Black Screen after displaying root view controller, ONLY when inheriting PayPalPaymentDelegate

查看:46
本文介绍了显示根视图控制器后出现黑屏,仅当继承PayPalPaymentDelegate时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是,当继承了PayPalPaymentDelegate的类时,我会在启动屏幕之后出现黑屏.

The problem is that I get a black screen after the splash screen ONLY when a class that inherits the PayPalPaymentDelegate.

一开始我以为是我的PayPalMobile绑定,所以我使用了

At the first I thought it was my PayPalMobile binding so I used this PayPalMobile binding by Alejandro. I got the same results by using his binding and mine.

我运行了 Alejandro示例应用并且可以完美地工作.我不知道为什么我黑屏.

I ran Alejandro sample app and it works flawlessly. I have no idea why I'm getting the black screen on mine.

什么可能导致我的项目出现此问题?

What could be causing this issue on my project?

我到目前为止所做的事情:

我将部署目标从8.4更改为9.2,并将主界面从无更改为LoginViewController,并收到了相同的问题.

I changed the deployment target from 8.4 to 9.2 and the main interface from none to LoginViewController and received the same issue.

制作了一个新的解决方案,添加了我的PayPalMobile绑定,并且可以正常工作.

Made a new solution, added my PayPalMobile binding and it worked.

根视图控制器确实会在进入黑屏之前显示.

The root view controller does show before going to a black screen.

所以,某种原因导致了解决方案中的问题,我不知道是什么原因.

So, something is causing the issue within the solution which I can't figure out what.

环境:

我正在使用最新的PayPalMobile

I'm using the latest PayPalMobile

使用Xamarin Studio 5.10.2

Using Xamarin Studio 5.10.2

使用iPhone 6s 9.2模拟器

Using iPhone 6s 9.2 simulator

Info.plist

Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDisplayName</key>
    <string>Test</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
    <string>9.2</string>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleIconFiles</key>
    <array>
        <string>Icon</string>
    </array>
    <key>UIBackgroundModes</key>
    <array>
        <string>location</string>
    </array>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeName</key>
            <string>MKDirectionsRequest</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.apple.maps.directionsrequest</string>
            </array>
        </dict>
    </array>
    <key>MKDirectionsApplicationSupportedModes</key>
    <array>
        <string>MKDirectionsModeCar</string>
    </array>
    <key>XSLaunchImageAssets</key>
    <string>Resources/Images.xcassets/LaunchImage.launchimage</string>
    <key>CFBundleIdentifier</key>
    <string>email@yahoo.com</string>
    <key>UIMainNibFile</key>
    <string>LoginViewController</string>
</dict>
</plist>

推荐答案

好的,我发现了问题.

在AppDelegate中,我在FinishedLaunching()方法内定义了UIWindow.

In AppDelegate, I defined the UIWindow inside the FinishedLaunching() method.

将UIWindow类用作替代,可以解决此问题.

Making the UIWindow class as override, fixed the problem.

在AppDelegate中:

In AppDelegate:

public partial class AppDelegate : UIApplicationDelegate 
{
    // This fixed the problem    
    public override UIWindow Window {
        get;
        set;
    }

    public override bool FinishedLaunching (UIApplication app, NSDictionary options)
    {    
        //This cause the black screen
        //UIWindow Window = new UIWindow (UIScreen.MainScreen.Bounds);
        Window = new UIWindow (UIScreen.MainScreen.Bounds);

        UINavigationController navController = 
                new UINavigationController (new ViewController ());
        Window.RootViewController = navController;
        Window.MakeKeyAndVisible();

        return true;
    }
}

这篇关于显示根视图控制器后出现黑屏,仅当继承PayPalPaymentDelegate时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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