uiwebview

UIWebView's “loadData” method does not accept nil for baseURL in Swift 2

百般思念 提交于 2019-12-12 14:18:39
问题 I don't want to pass any value to baseURL parameter in loadData method of UIWebView . In Swift 1.2, nil works fine: self.loadFundInfo.loadData(responseData, MIMEType: contentType, textEncodingName: "", baseURL: nil) In Swift 2.0, how to do the same thing? I am getting this error: Nil is not compatible with expected argument type NSURL 回答1: The error message is rather self-explanatory: the baseURL parameter must now be of type NSURL , not NSURL? (not an optional anymore, so it can not be nil).

UIWebview is not loading youtube videoes in iFrame

亡梦爱人 提交于 2019-12-12 14:13:44
问题 In my app I am using UIWebview to Load Html string which is having Text,Image Url and Videos in iFrame .This was working fine till now but recently I came to know that text and image url are loading fine and the video is not loading.I am just getting the blank space which I have allocated for the video but no sign of video. The video iFrame which I am getting is this: <iframe width="100%" height="" src="//www.youtube.com/embed/bhRqrw82P3A" frameborder="0" allowfullscreen></iframe> Please

UIWebView log message iOS 7 [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-12 13:06:26
问题 This question already has answers here : UITextField -webView no longer supported (2 answers) Closed 5 years ago . I am developing an app that use web browser after I built it I got this message: UITextField -webView called. This method is no longer supported with the new text architecture So what do I need to use right now? 回答1: Previously, UITextfield used a UIWebView internally for rendering rich text. This has been done away with the release of TextKit (or as they say it, "the new text

UIWebView canGoBack and canGoForward always return NO

≡放荡痞女 提交于 2019-12-12 13:02:03
问题 I am trying to load data directly into UIWebView : [webView loadData:data MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:nil]; The data is some html string contains some external links. I am trying to enable the back and forward buttons base on the UIWebView properties: self.forwardBtn.enabled = self.webView.canGoForward; self.backBtn.enabled = self.webView.canGoBack; However, even after I clicked on different links in the web view after the initial load, the webView.canGoForward and

Remove or change color of frame around UIWebView document display?

落花浮王杯 提交于 2019-12-12 12:12:16
问题 I'm using a UIWebView to display a variety of file types (so I can't use a specialized PDF viewer) embedded into my main view (so I can't use a modal document interaction controller). My main view has a background design that clashes with the light gray frame that appears around documents in the UIWebView . Does anyone know a way to remove that gray frame, make it transparent or change its color? I'm familiar with and have used the techniques for changing the background color of the UIWebView

UIWebView - Load a local .html file with linked resources

一曲冷凌霜 提交于 2019-12-12 12:11:58
问题 I don't know how many forums I have already read, but I really don't know why it doesn't work! I have an iPhone Application and I would like to show a Epub book to my user. The user can read it online, otherwise he can download it into the Application Documents directory to read it afterwards. I build this folder structure same like the online version and saved it into the document folder "frontend". I ALSO can read this maintaine .HTML file, BUT the linked JS / CSS and HTML files does not

How to use uiwebview to show some web page?

你。 提交于 2019-12-12 11:49:05
问题 How to use uiwebview to show some web page for url request? i dont know how to do it. who can tell me how to do it? has any opensource? thanks. 回答1: NSString *urlAddress = @"http://www.google.com"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; 来源: https://stackoverflow.com/questions/4456784/how-to-use-uiwebview-to-show-some-web-page

App Transport Security breaks Web View

跟風遠走 提交于 2019-12-12 11:35:38
问题 My app which works great under iOS8 no longer runs under iOS9. The problem is that despite having the following in my .plist file: <key>NSAppTransportSecurity</key> <dict> <!--Include to allow all connections (DANGER)--> <key>NSAllowsArbitraryLoads</key> <true/> </dict> The following code: NSURL *targetURL = [NSURL URLWithString:_caseStudyListTitleURL]; NSURLRequest *request = [NSURLRequest requestWithURL:targetURL]; [_myWebView loadRequest:request]; results in the error: NSURLSession

why is UIWebViewDelegate assign instead of weak?

被刻印的时光 ゝ 提交于 2019-12-12 11:34:07
问题 Normally all delegates throughout the UIKit/Foundation frameworks are weak except UIWebView. UIWebView's delegate @property(nonatomic, assign) id< UIWebViewDelegate > delegate; I am interested because this has caused a crash several time in my application when you forgot to nil out delegate while dismissing the UIWebView's ViewController. Normally you don't expect something like this, so there might be specific reason why this isn't set to weak by default. 回答1: Suppose if the

UIWebView crashes and i have no idea why

我们两清 提交于 2019-12-12 10:49:34
问题 Im having trouble trying to figure this problem out because no matter what I do to get my problem to work i keep getting this crash Heres the trace $0 = 0x1f8f9a10 ( 0 ??? 0x02b04144 0x0 + 45105476, 1 TheAppName 0x001016e0 start + 0, 2 Foundation 0x34334599 + 72, 3 WebCore 0x399e7bfb + 82, 4 UIKit 0x3595b493 + 182, 5 UIKit 0x358d7d1f + 382, 6 UIKit 0x358d7d33 + 402, 7 UIKit 0x358d7d33 + 402, 8 UIKit 0x358d7431 + 360, 9 UIKit 0x358d72c3 + 30, 10 UIKit 0x35ce2fef + 386, 11 UIKit 0x35ce3879 +