uiwebview

Simple rich text view in cocoa-touch

主宰稳场 提交于 2019-12-06 11:12:48
问题 I'm working on an iOS app in which I need to implement a basic text view with these requirements: Rich text Font emphasis (bold, italics). Inline images for hyperlink-like actions. Scrolling Getting and setting the scroll offset (for remembering the previous scroll position). Text selection Getting the selected text character range. Scrolling the view when selecting text, if needed. I believe I could achieve this with UIWebView but the problem with this is that it provides very little control

How to programmatically disable predictive view in WebView of iOS 8

纵然是瞬间 提交于 2019-12-06 10:47:37
问题 I'm designing a custom keyboard for iOS 8. It works fine on any UITextField but when it's in UIWebView, it shows predictions. Since it's allowed to have custom keyboard in iOS 8 I assume there should be a way to disable this view. Any help would be appreciated. Red area of the following picture: 回答1: I found a workaround solution for this problem. If you add type="email" instead of type="text" in your HTML file like bellow, iOS keyboard won't show the predictive view :) <input type="email"/>

How change min and max zoom scale in WKWebView?

情到浓时终转凉″ 提交于 2019-12-06 10:45:26
问题 I use WKWebView to show svg. It's rather big and i need support of scaling it on pinch gesture. WKWebView do it out of the box. But. It has it's own constraints for min and max zoom scale. For example: subscribe to WKWebView's scrollView delegate and implement method optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) { print(self.wkWebView.scrollView.minimumZoomScale, self.wkWebView.scrollView.maximumZoomScale) self.wkWebView

custom buttons on uiwebview(iphone)

妖精的绣舞 提交于 2019-12-06 10:16:44
问题 I want to add custom button on webView. they should also should be there when i try anything in url. how is it possible?? basically i want to put buttons on uiwebView and they are custom buttons //edited code... I am doing this...here link is appearing but method is not getting called...and there wasnot any error in your code ..:) NSString *imagePath = [[NSBundle mainBundle] resourcePath]; imagePath = [imagePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"]; imagePath =

UIWebView: Why does the request not time out when using a non-existant hostname?

痴心易碎 提交于 2019-12-06 10:11:07
My situation is this: I have a UIWebView which makes a POST request to a URL where the hostname is provided by the user. When the hostname does not exist, I need to timeout so that I can alert the user to say that they should check the their settings. What is happening: I make a request like this: NSString *theURL = [NSString stringWithFormat:@"https://%@%@", _hostname, LOGIN_PART_URL]; NSString *body = [NSString stringWithFormat:@"Username=%@&Password=%@", _username, _password]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:theURL] cachePolicy

How can i know web view is loading completed

孤人 提交于 2019-12-06 10:02:11
i have web view in that i am loading pdf file . pdf file has 2 mb size so it tacking time. i want to add indicator . for that how can i know my file is loaded in web view ? ... James P has the right answer (^'ed), but here is the code to show and hide the indicator. After you've registered with the UIWebViewDelegate ... - (void)webViewDidStartLoad:(UIWebView *)webView { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; // Other stuff... } And then - (void)webViewDidFinishLoad:(UIWebView *)webView { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; /

iOS WKWebView detect when reaches bottom

前提是你 提交于 2019-12-06 09:59:55
问题 I have a migration issue from UIViewView to WKWebView, detecting the Scroll View reached bottom when using WKWebView. Prior to WKWebView I used the UIScrollViewDelegate detecting wether the User had seen all of the content by scrolling till the end of the WebView. If he did, the "confirm" button was enabled. iPhone - knowing if a UIScrollView reached the top or bottom Now with WKWebView this doesn't work anymore. I guess the reason is, when using a WKWebView and load a html string, it scales

How to enter text into a textfield in a web view using UIAutomation

可紊 提交于 2019-12-06 09:54:07
My iOS app has a log-in page with username and password textfields. These text fields are in a web view. I am trying to automate the log-in process with UIAutomation . I know that working with content in a web view with UIAutomation is tricky. I am able to tap into the text fields using target.tap({x:100, y:200}); but I want to have UIAutomation enter text after the field has been tapped. How can I achieve this? Felix You can do something like: Get the reference to the webview var webView=window.scrollViews()[0].webViews()[0]; Tap the textView that you want to edit: webView.textFields()[0].tap

Dimiss keyboard when editing textfield on UIWebview

被刻印的时光 ゝ 提交于 2019-12-06 09:34:52
I'm opening a web page on UIWebview and this page has a textfield and a virtual keyboard the to enter password. But when edit the textfield iPhone virtual keyboard appears as well. I wanted to dismiss iPhone keyboard and on the same time continue editing the textfield. I have tried the following but it did not work. [webView stringByEvaluatingJavaScriptFromString:@"document.activeElement.blur()"]; And also tried to register for Keyboard notification so I can dimiss the keyboard but did not succeed. I would appreciate any ideas about how to achieve this. Thanks in advance. [

How to clear cookies for specific domain in iOS?

坚强是说给别人听的谎言 提交于 2019-12-06 09:29:05
问题 I have searched almost all questions on StackOverflow for answer to my question. I haven't found any useful link or tutorial saying which way is best to clear cookies for particular domain. So please if someone could help me. 回答1: I found solution myself. If you wish to delete entire cookies in your UIWebView do this. NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSHTTPCookie *cookie; for (cookie in [storage cookies]) { NSLog(@"%@", cookie); // Print the