![](/img/trans.png)
[英]Load Html string with image with base64 content in iOS UIWebView
[英]Load html content in UIWebView - iOS
我正在UIWebview(iPhone6)中加載html內容,並且該內容具有可操作的按鈕。 按下其中一個按鈕后,內容中間會彈出一個對話框(內容長約6-7頁)。 結果,用戶無法在第一個屏幕上看到彈出窗口。 早些時候,我認為這是內容的問題,但是在android上,彈出式窗口出現在首頁的中間。
-(void) loadScorm {
NSString *scormUrl = self.content.media.scormUrl;
scormUrl = [NSString stringWithFormat:@"%@%@", @"https:" , scormUrl];
NSURL *url = [NSURL URLWithString:scormUrl];
NSString *body;
body = //constructed body
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url];
[request setHTTPMethod: @"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[body dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]];
self.webView.scalesPageToFit = YES;
[self.webView loadRequest:request];
self.webView.frame = self.webViewContainer.frame;
}
我還讀到UIWebView的javascript默認是啟用的。 我想念什么? 任何指針將不勝感激。
PS:由於內容分類,無法共享屏幕截圖。
[webview loadHTMLString: [NSString stringWithFormat:@"<div id ='foo' align='justify' style='font-size:22px; font-family:helvetica; color:#ffffff';>%@<div>",[jsonObject objectForKey:@"msg"]] baseURL:nil];
希望你會發現有用
顯然,這是內容創建者的問題。 該人員不包括iOS平台上的Safari和Chrome支持,因此沒有這些問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.