uiwebview

Upload photo with UIWebView

血红的双手。 提交于 2019-12-02 00:42:27
问题 I would like to upload a photo directly from UIWebView that has a HTML form for file upload. When I click on button I get options to take photo or choose existing. But when I click any of these two options I get Warning: Attempt to present <UIImagePickerController: 0x15c15e00> on <UINavigationController: 0x155a2660> whose view is not in the window hierarchy! Could please anyone can explain me these warning... Thank you in advance! 回答1: It's a bug on iOS 8, that happens when the webview is

Show alert view when click on a link

自古美人都是妖i 提交于 2019-12-02 00:38:42
I use formatted text in UIWebView, i have something like this: <a href="tel://0442059840">0442059840</a> I need to show alert to the user when clicking on that link using the UIAlertView for confirmation before launching the telephone call. Is this possible? Thanx in advance. Yes but you need to use undocumented method for this. Search on google or stackoverflow you will find it easily. Here is a link for helping you. http://dblog.com.au/iphone-development/iphone-sdk-tip-firing-custom-events-when-a-link-is-clicked-in-a-uiwebview/ Override the delegate method webView:shouldStartLoadWithRequest

UIWebView content not adjusted to new frame after rotation

北城以北 提交于 2019-12-02 00:02:28
I have an e-mail application, which shows the content in an UIWebView inside an UISplitViewController . Everything works fine until i rotate the device, when already zoomed in/out in the UIWebView . When rotating the device, i adjust the frame of the UIWebView in - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration The problem is, when i zoomed in/out in the UIWebView and then rotate the device. The content isn't resized to it's new frame, which leads to a gray/black border in the content, or the content can be

How do I add Pull to Refresh in WebView?

假如想象 提交于 2019-12-01 23:54:35
I'm very new to developing. I'm building a WebView and I want it to have pull to refresh capabilities. How do I go about doing that in swift? My code in the View Controller is @IBOutlet var webView: UIWebView! override func viewDidLoad() { super.viewDidLoad() func webViewDidFinishLoad(webView: UIWebView) { UIApplication.sharedApplication().networkActivityIndicatorVisible = false } func webViewDidStartLoad(webView: UIWebView) { UIApplication.sharedApplication().networkActivityIndicatorVisible = true } let url = NSURL (string: "https://www.foo.com"); let requestObj = NSURLRequest(URL: url!);

UIWebView is not deallocating memory

∥☆過路亽.° 提交于 2019-12-01 22:55:29
问题 I'm having some real trouble trying to recover the memory I've allocated for a UIWebView within my application. I essentially create and present the UIWebView temporarily for the user in a separate ViewController , then remove all references and pop the ViewController from the stack. Despite doing all of this, the memory allocated is never returned, and I get stuck with an extra 10 Mb of memory each time I segue to that ViewController again. Let's see how I'm managing this UIWebView anyways.

Upload photo with UIWebView

我只是一个虾纸丫 提交于 2019-12-01 22:38:50
I would like to upload a photo directly from UIWebView that has a HTML form for file upload. When I click on button I get options to take photo or choose existing. But when I click any of these two options I get Warning: Attempt to present <UIImagePickerController: 0x15c15e00> on <UINavigationController: 0x155a2660> whose view is not in the window hierarchy! Could please anyone can explain me these warning... Thank you in advance! jcesarmobile It's a bug on iOS 8, that happens when the webview is presented modally. The only options right now it not to present the webview modally, you can

Can I run a UIWebView in a seperate thread?

一笑奈何 提交于 2019-12-01 22:17:50
问题 I have a web-view running JavaScript application, and sometimes it freezes/hangs when the main thread are performing heavier jobs like xhr calls and initializing video player. Is it possible to run a UIWebView in a separate thread, to avoid the web-view from being blocked? 回答1: UIWebView may make calls to UIKit which is in the main thread. Placing it in a separate thread will likely cause a crash. You can't create views on background threads, that's UI stuff. As Paul said in the comment, your

Disable long press menu in text area/input UIWebview

耗尽温柔 提交于 2019-12-01 21:26:51
问题 This seems to be one of the most frequently discussed topics here but I couldn't find a solution which actually works. I'm posting this question to share a solution which I found as well as hoping to find a better/cleaner solution Description of situation: There is a UIWebview in my application There is text input/area in the webview Long pressing on the text area/input brings up a context menu with 'cut', 'copy', 'define' etc. We need to disable this menu without disabling user input. What I

iOS7 UIWebView - Set content starting position below navigation bar

不想你离开。 提交于 2019-12-01 20:57:30
I have a UIViewController designed in a Storyboard (IB) as follows : UIWebView stretched to fill the entire canvas UIWebView has AutoLayout constraints to pin all 4 sides to the edges of the superview UIViewController has all 'Extend Edges' options ticked so UIWebView sits underneath navigation bar UIViewController has 'Adjust Scroll View Insets' unticked UIViewController is loaded within a UINavigationController What I want to happen when the VC loads is for the top of the UIWebView content to be positioned immediately below the navigation bar, and allow the user to scroll the content up the

How to see ping pong in web socket in iOS

你离开我真会死。 提交于 2019-12-01 20:51:41
I am doing websocket between webview in iOS and Socketserver. But I am unable to watch ping-pong that happens because javascript does not have any call back methods for it. Use Charles Proxy It has a tab called WebSocket that shows all web socket related conversations including frames such as Ping , Pong and Close . 来源: https://stackoverflow.com/questions/39914968/how-to-see-ping-pong-in-web-socket-in-ios