uiwebview

Cordova iOS 10.3.1 breaks input file for videos

杀马特。学长 韩版系。学妹 提交于 2019-12-03 08:27:57
This is similar to this much older issue: HTML file input with multi selection in UIWebView not working for videos This is NOT a duplicate of this: iOS update to 10.3.1 breaks HTML input element I have tested this on my app that was working, on versions going back 45 days, it seems iOS 10.3.1 changed the file input and now there is the multiple video selection, without the "compressing" stage that occurred after selection and before switching out of the interface. Tested on iphone 6S. When access the the video file via javascript, there is no size or content (compare to image at the bottom,

iPhone OS 3.2; PDF rendering; User Interaction

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 08:27:54
I'd need to create a iPad-app which would be rendering multiple PDF-Files (one file contains one page). Each page should be scrollable, zoomable and if the user taps on a part of the PDF a website or photo gallery should popup. Currently i think i could do that either with: A. UIWebView Displays the pdf's nicely, scrolling and zooming works. But it looks like a lot of trouble to realize the clickable parts of the PDF. I don't know if i could use CGPDFContextSetURLForRect Getting the touch-events from UIWebView to do something like CGPDFContextSetURLForRect my self looks like it would be some

iOS preserve state of UIWebView?

試著忘記壹切 提交于 2019-12-03 08:27:38
Is it possible to preserve the state of the UIWebView (e.g the current webpage, back/front list) in the current app launch ? For example, if I dealloc a webview, and at some point in the future, I want to recreate it - is it possible to give it the prior state? codercat Good Approach In iOS 6 and later, if you assign a value to this view’s restorationIdentifier property, it attempts to preserve its URL history, the scaling and scrolling positions for each page, and information about which page is currently being viewed. During restoration, the view restores these values so that the web content

page based load epub when changing font

假如想象 提交于 2019-12-03 07:59:56
I am doing ebook reader app like as iBooks. I have succesfully read a .epub file. But my problem is:- I have to add Font size increase and decrease and font changing functionality. I have to adjust pages When i increase and decrease font size . How can I split HTML string in pages ? . You can see in both images . After changing font size the html string gets separated and the formatting is getting collapsed. Thanks in advance Well, this is really a hard question... I have an idea for a method that splits a HTML page into two parts: the first page, and the rest. You can then repeatedly call

How to open & view view .doc, .docx, .rtf, .ppt, .pptx, .xlsx, .xls file in iphone using UIWebview in Document directory?

北城余情 提交于 2019-12-03 07:58:47
问题 Can we open & view .doc, .docx, .rtf, .ppt, .pptx, .xls, .xlsx file in iphone using UIWebview? I am using Document directory to show the file. .doc file is working fine here… but rest of the files' extensions are not working.. if any one has implemented this then please help me... any code snippet or any web link help... thanks in advance... 回答1: Try this: [self.m_webView loadRequest:[NSMutableURLRequest requestWithURL:[NSURL fileURLWithPath:_m_filePath]cachePolicy

Javascript call to Swift from UIWebView

本小妞迷上赌 提交于 2019-12-03 07:58:47
问题 I am trying to make a call from a javascript function in a UIWebView to Swift in iOS 10. I have setup a very basic project just to try and get this working, the code is below. import UIKit class ViewController: UIViewController, UIWebViewDelegate { @IBOutlet var webView: UIWebView! override func viewDidLoad() { super.viewDidLoad() let url = Bundle.main.url(forResource: "products", withExtension: "html") let request = NSURLRequest(url: url! as URL) webView.loadRequest(request as URLRequest) }

intercept copy, paste, define popover in UIWebView

霸气de小男生 提交于 2019-12-03 07:54:41
问题 When we highlight a text in UIWebView usually the copy, paste, define.. etc appears. How can I intercept this so that when I choose copy I call some other method/do something else. Is this possible? 回答1: You can simply override -copy: - (void)copy:(id)sender { // Do something else here return [super copy:sender]; } Edit to answer your comment. Define is a bit trickier, since it's private. However, you could implement your own method. Set up the UIMenuController with your desired items.

Detect single tap in UIWebView, but still support text selection and links

我与影子孤独终老i 提交于 2019-12-03 07:50:25
问题 I'm using JavaScript to detect taps in a page I'm showing in a UIWebView, like so: <div id="wrapper"> <a href="http://apple.com">Apple</a> </div> <script> document.getElementById("wrapper").addEventListener('click', function() { document.location = 'internal://tap'; }, false); </script> I'm intercepting links with my web view delegate, and look for "internal://tap". When I get that, I prevent the web view from navigating, and respond to the tap. However doing this I lose the ability to select

How to add controls beneath a UIWebView

爱⌒轻易说出口 提交于 2019-12-03 07:42:26
问题 What's the simplest, fastest, or otherwise (objectively) best way to add a couple of controls (e.g. some UIButtons) beneath a UIWebView? To be clear, I'd like to display a regular scrolling UIWebView, but when scrolling reaches the bottom I'd like there to be some UIControls after the web content. I'd rather not fake it with HTML/CSS content that looks like a control; ideally they should be real controls that I can hook up to my view controller as usual. I don't know whether it's easiest to

UIWebView LoadData is not accepting Nil values for textEncodingName and baseURL

末鹿安然 提交于 2019-12-03 07:39:54
问题 Till Swift 1.2 version, UIWebView LoadData was accepting nil values, but Swift 2.0 is throwing error "Swift does not conform to protocol NilLateralConvertible". Swift 1.2: Works fine self.webView.loadData(tempData!, MIMEType: "application/pdf", textEncodingName: nil, baseURL: nil) Swift 2.0: Throws error self.webView.loadData(tempData!, MIMEType: "application/pdf", textEncodingName: nil, baseURL: nil) 回答1: This works for me: webView.loadData(pdfDownload, MIMEType: "application/pdf",