uiwebview

Pass response from AFHTTPRequestOperation to UIWebview

那年仲夏 提交于 2019-12-07 11:05:27
问题 My code is making two requests to the server. One into the uiwebview directly and one with the AFHTTPRequestOperation. I'd like to use the AFHTTPRequestOperation and just pass the response into my uiwebview. What is the correct syntax for passing the response into the uiwebview and not loading it again? How do I do that without calling twice from the server? I still want to be able to test the success or failure of the load request and also send username and password to connect to the url. -

Detecting and intercepting video playback in UIWebView

无人久伴 提交于 2019-12-07 10:54:27
问题 I would like to intercept a click in an UIWebView and then use the URL of the video. How is this possible? I found a somewhat similar post which pointed met to the webView:shouldStartLoadWithRequest:navigationType: delegate. I cant seem to get the loaded url of the video with this delegate. I am trying to get the code working in iOS8 回答1: There is a hacky way of finding the URL by listening for the AVPlayerItemBecameCurrentNotification notification. This notification is fired when a UIWebView

webview clipped on ios7

放肆的年华 提交于 2019-12-07 10:15:44
问题 ![enter image description here][1]![enter image description here][2]Hy, I have developed a reader that shows on a webview the content of an html file after adding horizontal paging to it using .css. Everything was working fine but on ios7 I have noticed that the webview is getting clipped at the left edge I have tried the following: readingWebView.frame = CGRectMake(0, 0, 768, 920); [readingWebView loadHTMLString:loadString baseURL:nil]; readingWebView.autoresizingMask =

Help Using Javascript Code in a UIWebView

血红的双手。 提交于 2019-12-07 10:13:31
问题 I would like to run the following code in a webView, so that the content is editable: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0 So far I have got as far as trying this: - (void)webViewDidFinishLoad:(UIWebView *)webViews { NSString *string = @"javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0"; [webView stringByEvaluatingJavaScriptFromString:string]; [webView loadRequest:[NSURLRequest requestWithURL:[NSURL

Intercept unused tap events in a UIWebView

风格不统一 提交于 2019-12-07 10:03:55
问题 I'm working on an iPad app which is based on a UIWebView: to explain it in the simplest possible terms, the app shows one big interactive webview and in addition it supports custom gestures. I need to catch events that represent single taps on the webview, but only when the taps have not already been consumed by the webview (i.e. they are not the beginning of a scroll/zoom operation, they are not taps on links, they are not taps that trigger some javascript). The UIWebView is very greedy with

Does iPhone/iPad UIWebView need to be active view to render?

[亡魂溺海] 提交于 2019-12-07 09:01:07
问题 I need to render a web page offscreen to a bitmap, then show the bitmap to the user. Can this be done with simple code on the main thread like this: NSString *urlAddress = @"http://www.google.com"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [offscreenWebView loadRequest:requestObj]; Or do I need to attach the UIWebView to an active view? In Android, the web view seems not to render unless it is part of an active view. So to do

Swift: How to change only <img> or image sizes in webView

試著忘記壹切 提交于 2019-12-07 08:53:45
问题 I am getting HTML from a server and display it in a UIWebView.The "Scale Page to fit" option is not selected because of the requirement. The UIWebView width is equal to the screen width and height varies according to the content. The image tags in HTML contains some inline styling which are creating some problem in the view of webView. Screenshots are attached in 1st Image you can see the image is small because of small size set to it's inline styling. But 2nd one has larger image, so the

Is subclassing UIWebView frowned upon? [closed]

五迷三道 提交于 2019-12-07 08:44:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 months ago . I've heard varying things about whether or not creating a Subclass of UIWebView is allowable. Can someone link me to any documentation that clarifies this one way or another? 回答1: Under Subclassing Notes of the UIWebView reference, all it says is: Subclassing Notes The UIWebView class should not be subclassed.

UIWebView get HTML Source

随声附和 提交于 2019-12-07 08:12:19
问题 I am trying to get the HTML source of a UIWebView without re-downloading it again (a.k.a. do another download, such as [NSData dataWithContentsOfURL:(NSURL*)URL] or launching an NSURLRequest. Browsing the UIWebView header and documentation, there seems to be no way of accessing the current loaded NSData of the source. Am I missing something ? 回答1: The inverse should do what you want. That is, load the URL into an NSData object and then load the UIWebView from that object using – loadData

scalesPageToFit not working properly running an iPhone app on iPad (iOS 7)

那年仲夏 提交于 2019-12-07 08:04:22
问题 UIWebview scalesPageToFit is not working properly when running an iPhone app on iPad with iOS 7 . I set the scalesPageToFit = YES before loading the request to the WebView. After the page loads, inspecting the HTML document width gives 769px while the UIWebView's scroll view frame width is 320. The scroll view zoomScale is 1 although you would expect it to be 0.41... (320/769). Any idea? 回答1: The problem is now fixed in iOS 7.0.3. But, if you can't go there, please read on. This seems to be a