我正在为我的iOS应用程序使用azure。首先,控制器在登录时单击,我将调用azure的登录服务。
[client loginWithProvider:@"xxxxx" controller:self animated:YES completion:^(MSUser *user, NSError *error)在加载Azure登录页面之前,我可以看到一个大约5-6秒的白屏幕。
是否有可能解决问题,如果有,如何解决?我们是否需要更改Azure中的iOS。
发布于 2016-02-19 07:10:37
在Azure (https://github.com/Azure/azure-mobile-services/sdk/)中,打开iOS项目并导航到MSLoginView.m。将initWithFrame方法编辑到低于一个方法。重新生成框架文件并导入到项目中。
-(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:如果您获得所需的输出,请告诉我
https://stackoverflow.com/questions/34940589
复制相似问题