uiwebview

How to detect when UIWebView starts loading when Webview is inside a Collection View cell?

为君一笑 提交于 2019-12-24 08:42:21
问题 I am loading a collection view of cells containing UIWebView s. There's a time gap between when my UICollectionView 's activity indicator stops spinning and the UIWebView loads. I am trying to get a reference to when the loading starts (and eventually when it stops) in order to add another activity indicator UI. I'm not sure how to do it here though since my UIWebView is in my CollectionViewCell and not my CollectionView , in other words I can't use the delegate methods and set myself as my

How to change embed video size while playing in UIWebView?

人盡茶涼 提交于 2019-12-24 07:26:50
问题 I have a UIWebView with size 250x160 , which should play video from youtube.com. NSString *videoURL = @"http://www.youtube.com/v/Y4Y_a45Bv20?version=3&f=videos&app=youtube_gdata"; NSString *videoHTML = [NSString stringWithFormat:@"\ <html><body>\ <embed src=\"%@\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"%f\" height=\"%f\">\ </embed>\ </body></html>", videoURL, self.web.frame.size.width-20, self.web.frame.size.height-20]; [self.web loadHTMLString: videoHTML baseURL

UIWebView breaking constraint when playing a video in fullscreen (Xcode 6)

我是研究僧i 提交于 2019-12-24 07:08:09
问题 I'm updating an iOS app for an YouTube channel. In the previous version (iOS 7 using Xcode 5), I used to embed youtube iFrame in a UIWebView and everything would work just fine. However, in iOS 8 using Xcode 6, every time I play a Youtube video and it goes full screen, my UIWebView constraints break and UIWebView gets relocated in my Controller (usually goes 10 points up in the screen). I've tried to change the constraints but it seems that doesn't matter what constraint I set up, it will

Why doc and docx losing style information in iOS?

人走茶凉 提交于 2019-12-24 06:37:40
问题 I wanted to open a docx, doc file in iOS. I tried two ways: 1.Web view 2.QLPreviewController In both the ways I am losing the style information associated with the document. WHy this happens? Is in any way possible to retain the style information. Is there any way we can retain this information? The Style could be: A table in document - displayed with doc format but not with docx format Particular text in the document alone can be hightlighted with a color 回答1: iOS has support for MS Office

Swift 3, iOS 10.3 - Preload UIWebView during Launch Screen

柔情痞子 提交于 2019-12-24 05:58:34
问题 I have an App, which has multiple WebViews on different ViewControllers but it takes about 3 seconds to load each of them. Is it possible to start loading the webpages during the Launch Screen or to load the WebView of the SecondViewController when the user is on the webpage on the FirstViewController? import UIKit class dabs: UIViewController { @IBOutlet weak var webView_dabs: UIWebView! override func viewDidLoad() { super.viewDidLoad() let websiteURL = URL(string: "https://www.skybriefing

UIWebView: How to insert text in a HTML text field

末鹿安然 提交于 2019-12-24 05:18:04
问题 I've an UIWebView where a mobile web form URL is loaded. In a method in my application, I would like to insert some text into the HTML text field in the UIWebView which has focus. How can I do that? Is there a way to get the ID of the HTML element which has focus -- than I can insert the text into this element using JavaScript? 回答1: The sole way you have to affect the page loaded into the UIWebView is -stringByEvaluatingJavaScriptFromString:. The least troublesome way would probably be to set

UIWebView: Disable copy/cut options for a rich text editor

时光总嘲笑我的痴心妄想 提交于 2019-12-24 04:09:10
问题 I have a UIWebView with a contentEditable div in order to implement some kind of rich text editor. I need to trimm the copy & cut options in the UIMenuController that appears in the web view once the user selects any piece of text. There seems to be a lot of solutions around the web, but for some reason, non of them applies for my scenario. I've subclassed the UIWebView and implemented the canPerformAction:(SEL)action withSender: to remove the copy and cut, but once the user chooses "Select"

UIWebView lower loading time with a more efficient way

家住魔仙堡 提交于 2019-12-24 02:56:23
问题 I'm downloading multiply htmls and save them locally as strings in an NSArray . Then I'm using 3 UIWebViews to load the content. The user always sees one UIWebView and 2 more UIWebViews are loaded in the background using: [_firstWebView loadHTMLString:nextHtml.body baseURL:nil]; When the user moves around between UIWebViews I can still see slow loading times of 1-2 seconds if he moves 2 UIWebViews at a time. I thought about going to 5 or even 7 UIWebViews but I'm afraid it will impact the

iOS UIWebView: How can I figure out what the previous URL is?

喜欢而已 提交于 2019-12-24 02:39:10
问题 I'm rewriting the goBack function with my own because I need to be able to change the URL depending on whether the orientation changed or not. How can I access the URL history and figure out the previous one? 回答1: You need to implement the UIWebViewDelegate. It has methods that will allow you to control the back functionality as well as letting you capture the URL when you navigate to it. 来源: https://stackoverflow.com/questions/7958601/ios-uiwebview-how-can-i-figure-out-what-the-previous-url

How to take PRINT of content from UIWebView?

坚强是说给别人听的谎言 提交于 2019-12-24 02:31:46
问题 I am using swift, i need to take print of a sheet which is opened in UIWebView. let url = webView.request?.url let stringurl = url?.absoluteString let pic = UIPrintInteractionController.shared let printInfo : UIPrintInfo = UIPrintInfo(dictionary: nil) printInfo.outputType = UIPrintInfoOutputType.general printInfo.jobName = stringurl! pic.printInfo = printInfo pic.printFormatter = webView.viewPrintFormatter() pic.showsPageRange = false pic.present(animated: true, completionHandler: nil) 回答1: