uiwebview

UIWebView: decidePolicyForNavigationAction?

强颜欢笑 提交于 2019-12-24 13:42:57
问题 I'm using a UIWebView in my app, and everything works fine in iOS5 and 6. But on iOS7 the UIWebView can't load the page requested (an html from internet) and start an infinite loop with this error every 10 secs: void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode The webview loadrequest is located in viewDidAppear. I found no

Audio in html of ios webview control doesnot work

◇◆丶佛笑我妖孽 提交于 2019-12-24 13:23:00
问题 I have included a audio tag in html and i am loading the html inside the UIWebview control. The audio plays when i click on the play button. But when i put the phone in silent mode it stops playing and instead goes on mute. I want the audio to play even when the phone is in silent mode. Can anyone please help me with this? 回答1: Please add below code:- NSError *setCategoryErr = nil; NSError *activationErr = nil; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:

UIWebView clears cache After Application Exit & Not caching images offline

痴心易碎 提交于 2019-12-24 13:13:15
问题 HTTP Response Header Name Value Delim Status: HTTP/1.1 200 OK Server: Apache Content-Type: image/jpeg Accept-Ranges: bytes Last-Modified: Wed, 16 Oct 2013 12:06:35 GMT Content-Length: 54556 Cache-Control: max-age=604800 Expires: Thu, 24 Oct 2013 09:32:54 GMT Date: Thu, 17 Oct 2013 09:32:54 GMT Connection: close When I run the application Once everything runs Fine and Yes images are cached for Application Life Time, But when I close application and Run again with WIFI off. Image do Not appear.

Modify Specific UIWebView code to have an address bar similar to Safari

时光毁灭记忆、已成空白 提交于 2019-12-24 12:32:54
问题 I've built an app using PhoneGap and am using its InAppBrowser plugin. For the iOS platform, the InAppBrowser is implemented using an UIWebView. The "address bar" is a simple UILabel so it is basically read-only from the user's perspective. I'd like to extend the plugin to have a simple functioning address bar. You know, let the user type in new URLs and show little inline refresh and go buttons. Basically like a regular browser such as Mobile Safari, Chrome, etc. I know 99 programming

Video orientation after launched from UIWebView

此生再无相见时 提交于 2019-12-24 12:08:15
问题 I have an UIWebView that has an youtube's embed code (iframe). I'd like to enable both portrait and horizontal orientation for the video player, but portrait mode only for the UIWebView itself. How can I achieve this? 回答1: The UIWebView displays its content by its orientation. There is no (easy) way to conditionally change which orientations the UIWebView allows based on its content. The only way I can imagine this working is by parsing the HTML of the web view and based on its content,

I dont want auto play the in UIWebview play youtube video

梦想与她 提交于 2019-12-24 11:08:58
问题 ideoView = [[UIWebView alloc] initWithFrame:CGRectMake(60, 20, 200, 184)]; videoView.delegate = self; videoView.scrollView.bounces = NO; videoView.allowsInlineMediaPlayback = YES; videoView.mediaPlaybackAllowsAirPlay = YES; videoView.mediaPlaybackRequiresUserAction = NO; [self.view addSubview:videoView]; NSString* embedHTML = [NSString stringWithFormat: @"<html><body style='margin:0px;padding:0px;'><script type='text/javascript'src='http://www.youtube.com/iframe_api'></script><script type=

Loading gif image in UIWebview - iPhone

廉价感情. 提交于 2019-12-24 09:58:29
问题 When Iam loading a gif image in UIWebview in the iPhone 4.3 simulator it is getting an error like ImageIO: <ERROR> _CGImagePluginInitGIFmalformed GIF frame#0 (640 x 960) And the gif image is not showing. Can anyone help me... 回答1: Now in iPhone , Apple not supported .gif images. You can use other type of images like png, jpg.. If you have a serie of images you want to animate you can easily do it with UIImageView: UIImage *image1 = [UIImage imageNamed:@"image1.png"]; UIImage *image2 =

Cross View Communication

别来无恙 提交于 2019-12-24 09:49:10
问题 I have a UIWebView on my main window. Can I control that via my second view controller? If so could you give me an example? 回答1: Yes you can. The "how" is a basic Cocoa / application architecture subject you can learn from the introductory documentation from Apple or any number of other web sites. The gist is that you need to have a reference to the web view's controller (or the web view itself) from the second controller. This could be an outlet or a regular instance variable in the second

Get page loaded Event on Webview

孤街浪徒 提交于 2019-12-24 09:19:23
问题 Example URL: https://unifiedportal-mem.epfindia.gov.in/memberinterface/ From this click on Forgot Password then Input UAN as: 101010101010 type captcha and submit. How to obverse page didFinish on this? How to get the message "UAN is not Active" which comes after loading. This didFinish function of webView doesn't work in this scenario as page is already loaded. func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!{ } Tried below way but no response. Got this Error Domain

UIWebView html file with swf load external link, but internal

醉酒当歌 提交于 2019-12-24 09:15:13
问题 When I load an external HTML with SWF embedded, it work in UIWebView. When I try to add all files in Xcode, and load the UIWebView local, nothing appears, but I know it tried to load ... -The Code: NSString *filePath = [[NSBundle mainBundle] pathForResource:@"vimmar" ofType:@"html"]; NSData *htmlData = [NSData dataWithContentsOfFile:filePath]; if (htmlData) { NSBundle *bundle = [NSBundle mainBundle]; NSString *path = [bundle bundlePath]; NSString *fullPath = [NSBundle pathForResource:@"vimmar