首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在加载Azure登录页面之前,会出现白色屏幕。

在加载Azure登录页面之前,会出现白色屏幕。
EN

Stack Overflow用户
提问于 2016-01-22 06:44:01
回答 1查看 287关注 0票数 0

我正在为我的iOS应用程序使用azure。首先,控制器在登录时单击,我将调用azure的登录服务。

代码语言:javascript
复制
[client loginWithProvider:@"xxxxx" controller:self animated:YES completion:^(MSUser *user, NSError *error)

在加载Azure登录页面之前,我可以看到一个大约5-6秒的白屏幕。

是否有可能解决问题,如果有,如何解决?我们是否需要更改Azure中的iOS。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-19 07:10:37

在Azure (https://github.com/Azure/azure-mobile-services/sdk/)中,打开iOS项目并导航到MSLoginView.m。将initWithFrame方法编辑到低于一个方法。重新生成框架文件并导入到项目中。

代码语言:javascript
复制
-(id) initWithFrame:(CGRect)frame
         client:(MSClient *)client
       startURL:(NSURL *)startURL
         endURL:(NSURL *)endURL
     completion:(MSLoginViewBlock)completion;
{
    self = [super initWithFrame:frame];
    if (self) {
        // Capture all of the initializer values as properties
        client_ = client;
        startURL_ = startURL;
        endURL_ = endURL;
        endURLString_ = endURL_.absoluteString;        
        completion_ = [completion copy];

        // Create the activity indicator and toolbar
       activityIndicator_ = [[UIActivityIndicatorView alloc]
     initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
       activityIndicator_.alpha = 1.0;
       activityIndicator_.center = CGPointMake([[UIScreen mainScreen]bounds].size.width/2, [[UIScreen mainScreen]bounds].size.height/2);
       [self addSubview:activityIndicator_];

       toolbar_ = [self createToolbar:activityIndicator_];
        [self addSubview:toolbar_];

        // Set the toolbar defaults
        showToolbar_ = NO;
        toolbarPosition_ = UIToolbarPositionBottom;

        // Create the webview
        webView_ = [[UIWebView alloc] init];
        [webView_ setOpaque:NO];
        webView_.backgroundColor = [UIColor clearColor];

        webView_.scrollView.scrollEnabled = NO;
        webView_.scrollView.multipleTouchEnabled = NO;
        [webView_.scrollView setBouncesZoom:NO];//disable ZOOM Functionality
        webView_.scalesPageToFit = YES;
        webView_.delegate = self;
        [self addSubview:webView_];
        webView_.hidden =YES;


        // Call setViewFrames to update the subview frames
        [self setViewFrames];

        // Start the first request
        NSURLRequest *firstRequest = [NSURLRequest requestWithURL:startURL];
        [webView_ loadRequest:firstRequest];
    }
    return self;
}

@ know 203538:如果您获得所需的输出,请告诉我

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34940589

复制
相关文章

相似问题

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