uiwebview

UIWebView - capturing clicks

家住魔仙堡 提交于 2019-12-03 22:04:42
Is there a way to capture clicks on links within a UIWebView. I want to find out the address that the user has clicked, but not actually go to the page. Is this possible? Yes there is a delegate method you're view controller can implement: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType reference: http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView:shouldStartLoadWithRequest

Location Service in UIWebView on iOS8 beta 5 not working

独自空忆成欢 提交于 2019-12-03 21:58:18
Yesterday we tried the developer previews iOS 8 beta 5 with Xcode 6 Beta 5 for our App. We use location services in the webview components of our hybrid app. I recognized that geolocating via UIWebView ist not working anymore. I verified this behavior with an example from scratch loading example for geolocation from the w3schools.com into a UIWebView. With iOS 7, (Base SDK 7.1, built with XCode 5), the notification for acceptance of the location service is prompted an after that, the app shows up under Privacy--> Location Services in the iPhone settings. With iOS 8, (Base SDK 8, built with

UIWebView in UITableViewCell getting refreshed while scrolling

≡放荡痞女 提交于 2019-12-03 21:44:07
I've a custom UITableViewCell with UIWebview to display the hyperlink text in user's activity (ref. attached image).UIWebView generally takes a sec to load HTML data. Also during scrolling, UIWebView will get refreshed again and it take a sec more, which looks very odd. I tried FancyLabel , but not able to achieve the same result. Any help would be appreciated. itsdamslife Try NSAttributedString for this problem. Follow the mentioned links : http://developer.apple.com/library/mac/#qa/qa1487/_index.html http://snippets.aktagon.com/snippets/358-How-to-make-a-clickable-link-inside-a-NSTextField

Knowing when a YouTube video starts playing from within a UIWebView

删除回忆录丶 提交于 2019-12-03 21:33:19
I have made a class that plays YouTube videos (thanks to the help from the kind people of this site). Now I am wondering how I find out when a YouTube video starts playing. I want to know this so I can show a "Please Wait, Loading..." indicator in-between the video being told to play and it actually playing. I start the video playing using stringByEvaluatingJavaScriptFromString: , and of course there is a slight delay between me firing off the javascript command to get the video playing and the video actually playing. I am familiar with YouTube videos and javascript, so Ive been looking at

UIWebView inside a UITableViewCell

五迷三道 提交于 2019-12-03 21:31:07
Has anyone tried it? The hardest part for me is to get the height of the UITableViewCell to be the same as that of the UIWebView. By debugging into the code, I noticed that the delegate for UITableViewCell (heightForRowAtIndexPath for getting the height of the cell) is called before the one (webViewDidFinishLoad) for UIWebView is called. Any solution to work around that? Super thanks! Ken Pespisa I saw this scenario demonstrated once on the iTunesU Stanford iPhone Application Development course. It's shown at the end of lecture 16, from the Spring 2009 sessions This similar question on SO

UIWebview keyboard return key pressed ios 7

浪尽此生 提交于 2019-12-03 21:26:39
i am trying to find out a solution when the return key of UIWebview is clicked ! i tried the following links but it's not working ! UIWebView, customize "return" key How to detect keyboard enter key? i want to do some offset work when user is typing on the UIWebview and return key is pressed ! Here is the code i am using ! - (void)viewDidLoad { [super viewDidLoad]; NSString* plainContent = @"Edit here....."; NSString* htmlContentString = [NSString stringWithFormat: @"<html>" "<body>" "<div id=\"content\" contenteditable=\"true\" style=\"font-family: Arial\">" "%@" "</div>" "</body></html>",

UIWebView Text Highlighting solution

萝らか妹 提交于 2019-12-03 21:25:32
Has anyone found a solution for highlighting user-selected blocks of text in a UIWebView? I have a partial solution in place, however I have been unable to get it to work when the selection includes multiple elements in the DOM. In that case, I can find and highlight the first element in the selection, but javascript seems unable to tell me where the end of the selection is in this case. It may be that I just don't understand the selection objects completely. It's difficult to find good documentation on them. Tim Down You can use document.execCommand("HiliteColor") . I answered a similar

UIWebView execCommand Cut, Copy, Paste

天涯浪子 提交于 2019-12-03 21:22:32
I can't seem to get the execCommand for cut, copy, paste to work in a UIWebView that has contentEditable set to true. I am able to select the text using selectAll command but cut, copy, and paste do not work. This is the code I'm using: [webView stringByEvaluatingJavaScriptFromString:@"document.execCommand('cut', false, null)"]; Is there something else I need to do to allow clipboard operations to work? As per previous comments cut, copy, paste commands don't appear to work so I managed to achieve the same operations like so: - (void)cut { NSString *selection = [self.webView

Embedded video playing with multiple orientations?

99封情书 提交于 2019-12-03 20:55:20
I want to play dailymotion and youtube videos in my UIWebView control. And I'm using following embedded html code to play and it's working fine. But as device is being rotate, it's not resetting accordingly and if I call the following code again it will start to play video from beginning. NSString* embedHTML = @"<html><head><style>body {\"background-color:transparent;color:black;\"}</style></head><body style=\"margin:0\"><embed id=\"yt\" src=\"%@\"type=\"application/x-shockwave-flash\"width=\"%.0f\" height=\"%.0f\"></embed></body></html>"; NSString* html = [NSString stringWithFormat:embedHTML,

UIWebView does not load the URL

与世无争的帅哥 提交于 2019-12-03 20:29:47
I have very small problem while loading the URL in UIWebView . I have one UIButton , on clicking of it, I add the UIView which contains UIWebView , UIButton & Title bar . Code used is as follows - [self.view addSubview:vwOnline]; vwOnline.bounds = self.view.bounds; //Load webview NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@", objWine.strOnlineURL]]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [wbvwOnline loadRequest:request]; - (void)webViewDidStartLoad:(UIWebView *)webView { //Show activity indicator [indicator startAnimating]; } - (void