uiwebview

Load image/logo in existing HTML input field - UIWebView

半腔热情 提交于 2019-12-01 12:06:56
问题 as I'm new to programming I've done something like this : - (void)completeUserFieldsForWebView:(UIWebView *)webView withUsername:(NSString *)username { // TextField Which has Value "email" NSString *loadUsernameJS = [NSString stringWithFormat:@"var inputFields = document.querySelectorAll(\"input[type='email']\"); \ for (var i = inputFields.length >>> 0; i--;) { inputFields[i].value = '%@';}", username]; // TextField Which has Value "Text" if email is not found NSString *loadText = [NSString

code to open .docx in iphone webView

不羁的心 提交于 2019-12-01 11:28:07
问题 I'm new in iPhone, I'm trying to open .docx file in UIwebView, I wrote the following code NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"Arabic literature" ofType:@"docx"]; NSURL *url = [NSURL fileURLWithPath:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; NSData *data = [NSData dataWithContentsOfFile:urlAddress]; //[_webView loadRequest:requestObj]; [_webView loadData:data MIMEType:@"application/vnd.ms-word" textEncodingName:@"UTF-8" baseURL:nil];

Detect when I scroll my UIWebView at top of the page

半城伤御伤魂 提交于 2019-12-01 11:09:29
I would like to add an URL/google bar on top of my webview, and access it by scrolling up my web page exactly as Safari do. To do this, I would detect when the user is scrolling the page, and more over when the scroll reaches the top. But I really don't know how. An idea ? Thanx a lot. Martin I was also digging for the same and found a solution. I coded the following method to detect the scrolling coordinates. See below: -(void)userDidScrollWebView:(id)scrollPoint{ // NSLog(@"scrolled:::"); NSString *x1 = [webView stringByEvaluatingJavaScriptFromString: @"scrollX"]; NSString *y1 = [webView

Swift: Triggering TableViewCell to lead to a link in a UIWebView in another ViewController

痴心易碎 提交于 2019-12-01 10:40:53
问题 When i tap a tableViewCell I want a link (that is specific to that cell's indexPath.row ) to open up in a new viewController with a webView. Example: I tap the 3rd cell in the tableView and www.apple.com opens up on a new viewController. I'm trying to do that with didSelectRowAtIndexPath but I can't figure out how to put the code together so that the code from the linksArray (where i have all the links stored) works together when I tap the tableViewCell I'm querying these links from Parse.com

How to play youtube video in UIWebView muted?

可紊 提交于 2019-12-01 10:40:20
I am using UIWebView to play an embedded youtube video, on iOS 9 for iphone. However, due to a known issue , the volume control is not working, i.e. calling player.mute() or player.setVolume(0) doesn't work at all: https://github.com/youtube/youtube-ios-player-helper/issues/20 I am wondering if anyone has successfully worked around this? Could you share your method. The sample embedded html I am using: <html><body style='margin:0px;padding:0px;'> <script type='text/javascript' src='http://www.youtube.com/iframe_api'></script><script type='text/javascript'> var player; function

display specific pdf page in the UIWebview ios

孤街浪徒 提交于 2019-12-01 10:03:44
问题 I am currently working on a project and I have ios need to display a pdf file. However i want choose the page to display. For example see page 10 of 37 in a UIWebView. I have not found a way to cleanly separate the pages of a pfd. thank you for your help. 回答1: You can use setContentOffset property of webview to show that page, [[webView scrollView] setContentOffset:CGPointMake(0,10*pageheight) animated:YES]; where pageheight=your page height, 10 is your page no, 回答2: Use UIWebView's delegate

How to detect keyboard enter key?

柔情痞子 提交于 2019-12-01 09:47:06
问题 I have on UIWebView in that i am allowing editing at runtime. Now when i click on UIWebView then iPad keyboard opens for writing, now my requirement is how to detect that I have clicked on enter key of iPad keyboard?. I know that we can achieve this if we are editing in UITextView or UITextField with using it's delegates.Help me! I have one function in javascript that detects it. function returnEnterPress(e){ var key; if(window.event) key = window.event.keyCode; //IE else key = e.which; /

How to get hash fragment of URL from UIWebView

心不动则不痛 提交于 2019-12-01 09:38:38
问题 I'm trying to get hash fragment of URL loaded in UIWebView, I have tried different approaches it does not seem to work. For example if the UIWebView is loaded with "http://www.mysite.com/home#main": NSURL *url = [NSURL URLWithString:@"http://www.mysite.com/home#main"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request]; then I want to get the full url, but it only return "http://www.mysite.com/home" with 3 different approaches: 1: NSString *currentURL =

How to play youtube video in UIWebView muted?

岁酱吖の 提交于 2019-12-01 09:34:13
问题 I am using UIWebView to play an embedded youtube video, on iOS 9 for iphone. However, due to a known issue , the volume control is not working, i.e. calling player.mute() or player.setVolume(0) doesn't work at all: https://github.com/youtube/youtube-ios-player-helper/issues/20 I am wondering if anyone has successfully worked around this? Could you share your method. The sample embedded html I am using: <html><body style='margin:0px;padding:0px;'> <script type='text/javascript' src='http://www

open iBooks from my app

非 Y 不嫁゛ 提交于 2019-12-01 09:22:50
I have some PDF in my app. I want to provide an option to open those PDF in other third party e-readers app that might be installed on the device, like Stanza and iBooks. Dropbox application has successfully implemented this feature and I can't find any information on how to detect what other e-readers are available on the device or what the custom url scheme is for those apps. Any help would be greatly appreciated. thanks in advance guys. Check this out! http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIDocumentInteractionController_class/Reference/Reference.html#/