我有一个奇怪的问题, http://tmskiosk.oneclick.info/sso/userauth.aspx
这个我在浏览器中打开的链接工作正常,但是当我在webview中打开它时,它没有加载它的css文件(可能)。
NSString *urlAddress = [NSString stringWithFormat:@"http://tmskiosk.oneclick.info/sso/userauth.aspx"];
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]
[siteWebView loadRequest:requestObj];
答案 0 :(得分:0)
尝试使用以下方法。
WebView loadHTMLString:<#(NSString *)#> baseURL:<#(NSURL *)#>
答案 1 :(得分:0)
//Load web view data
NSString *strWebsiteUlr = [NSString stringWithFormat:@"http://tmskiosk.oneclick.info/sso/userauth.aspx"];
NSString *escapedUrlString = [strWebsiteUlr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// Load URL
//Create a URL object.
NSURL *url = [NSURL URLWithString:escapedUrlString];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[_webview loadRequest:requestObj];