UIWebview 不会显示 Https (iPhone)
所以我写了一个 UIWebView 但当我尝试加载 https 页面时它不会加载...这是我的 WebView 的 .m 页面。
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization.
}
return self;
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://psportal.hbuhsd.org/ResetPassword.aspx"]]];
webView.scalesPageToFit = YES;
//Navigation Name:
self.title = @"facebook";
[super viewDidLoad];
}
-(void)webViewDidStartLoad:(UIWebView *)webView {
[activityIndicator startAnimating];
activityIndicator.hidden = NO;
}
-(void)webViewDidFinishLoad:(UIWebView *)webView {
[activityIndicator stopAnimating];
activityIndicator.hidden = YES;
}
So i wrote up a UIWebView but when i try to load an https page it wont load... here is my .m page for the WebView.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization.
}
return self;
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://psportal.hbuhsd.org/ResetPassword.aspx"]]];
webView.scalesPageToFit = YES;
//Navigation Name:
self.title = @"facebook";
[super viewDidLoad];
}
-(void)webViewDidStartLoad:(UIWebView *)webView {
[activityIndicator startAnimating];
activityIndicator.hidden = NO;
}
-(void)webViewDidFinishLoad:(UIWebView *)webView {
[activityIndicator stopAnimating];
activityIndicator.hidden = YES;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第 1 步:确保您的 webView 已连接到您的 xib?
第2步:如果您尝试使用 xib 调用 viewController
覆盖 init 方法
并仅使用 init 方法初始化您的类
例如 :
加载视图
并实现所有必需的 webView 委托方法,特别是 didFailLoadWithError (
它告诉您 Web 视图是否无法加载内容
)Step1 : Make sure you webView is connected to your xib?
Step2 : If you are trying to call your viewController with xib
override the init method
And initialize your class with just init method
for example :
and after loading the view
and implement all the required webView delegate method specially didFailLoadWithError (
which tells you if a web view failed to load content
)