uiwebview

Cannot convert value of type 'UIView' to expected argument type 'UIWebView'

爷,独闯天下 提交于 2019-12-10 17:33:53
问题 I am using cordova-plugin-iosrtc. I am experiencing the following error. iOSRTCApp-master/platforms/ios/iOSRTCApp/Plugins/cordova-plugin-iosrtc/iosrtcPlugin.swift:622:24: Cannot convert value of type 'UIView' to expected argument type 'UIWebView' According to repository,I should not get this error. Here is the code snippet let pluginMediaStreamRenderer = PluginMediaStreamRenderer( webView:self.webView!, eventListener: { (data: NSDictionary) -> Void in let result = CDVPluginResult(status:

Get loaded images from UIWebView

老子叫甜甜 提交于 2019-12-10 17:31:11
问题 In my app there's a UIWebView . The loaded webpage in it has some images, and I would like to use these images in somewhere else (e.g. display them in UIImageView ) So is it possible to get the loaded images directly from UIWebView without downloading them again? What I am doing now is get the URLs to the images from the html file and download them, but this is too time consuming. 回答1: I've figured this out: the key is to extract the images from the NSURLCache . However, since iOS 8, it seems

Change font size for web view in Iphone SDK

牧云@^-^@ 提交于 2019-12-10 17:28:46
问题 I have implementing feed parsing & get the content as a string. Now, I am making html file through it programetically. Load that HTML in the Web view. My web View is the subview in Table View cell. But Now i want to change the font size of web view content, so the user can see some detail . My code for HTML generation is: NSString * postHTML=[[_parseResults objectAtIndex:indexPath.row]valueForKey:@"summary"]; NSString *close =[NSString stringWithFormat:@"</body></html>"]; NSString *HTMLString

How to change the color and font size UIWebview

ⅰ亾dé卋堺 提交于 2019-12-10 17:17:36
问题 In my application I am loading HTML String which is parsed from the json file the string already contain font color and font size but I need to change the color and size of the font. To replace that I have already use the followings code but its not working NSString *webString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'", textFontSize]; [web stringByEvaluatingJavaScriptFromString:webString]; Is there is any other way to

response UIWebView click action to call up native code page

烈酒焚心 提交于 2019-12-10 17:12:52
问题 I'm looking for a way to listen for an action in a UIWebView. For example: When I tap a link or button inside a UIWebView, I want to call up a new native component, like a comment page. Or. take some other action like change a navigationBar item. 回答1: Yes you can do this. Implement – webView:shouldStartLoadWithRequest:navigationType: This delegate . This method gets called whenever your webview is about to make a request. So now when someone clicks a button or hyperlink on your webpage, you

YouTube embed AirPlay UIWebView

拈花ヽ惹草 提交于 2019-12-10 17:04:52
问题 I am developing a video application which contains a lot of video from different sources. One of the options in the application has to be to play videos through airplay on a TV. For displaying YouTube video in my application I am using YTPlayerView, which is an objective-C helper for the YouTube API. My question is: is there an option or param I can pass so the YouTube video can also be played through Airplay? I couldn't find anything useful on Internet. 回答1: In - (BOOL)loadWithPlayerParams:

loadData:MIMEType:textEncodingName:baseURL: in WKWebView

谁说胖子不能爱 提交于 2019-12-10 16:47:42
问题 I'd like to use WKWebView instead of a UIWebView to display data on iOS. However, it seems that loadData:MIMEType:textEncodingName:baseURL: was removed in WKWebView. Is there any way to mimic this functionality in WKWEbView? Thanks! 回答1: You could convert your NSData to NSString and use loadHTMLString:baseURL: (API Docs). However, that method has issues with file-system base URLs in the latest beta: WKWebView not working in iOS 8 beta 4. 回答2: As of iOS 9.0 and onwards WKWebView now has the

iOS use UIKeyboardTypeDecimalPad in UIWebView form input

ぐ巨炮叔叔 提交于 2019-12-10 16:14:20
问题 I want to show the decimal pad with a '.' in the left corner used by native apps in a cordova based app. I have seen a lot of threads using private APIs etc. but I want a solution that would go for app store submission. Any help is appreciated. I have already tried something from this thread. Below is my modification, @protocol TSPingPong <NSObject> - (void) ts_pong: (id) sender; @end @interface NSObject (TSPingPong) @end @implementation NSObject (TSPingPong) - (void) ts_ping: (id) sender {

iOS WebView blank gap

血红的双手。 提交于 2019-12-10 15:59:58
问题 I have embedded a Youtube video in my iOS 8.3 app using youtube's standard embed url (sample) which is working as expected but looking pretty weird. That white gap (blue zone on the view tree inspector) should not be there. I can confirm it's not a CSS issue as the inspector shows it is effectively occupying 100% width and height of the uiWebView component. I have setup constraints to the left, top and right borders to equate the window/layout guides so that's not the problem either. It seems

NVActivityIndicatorView only for particular view

本小妞迷上赌 提交于 2019-12-10 15:24:00
问题 I am using this library https://github.com/ninjaprox/NVActivityIndicatorView for showing the loading indicator. By default it blocks the entire view controller but how can I show the activity indicator only for the particular view. For example if a view controller contains a webview and some other view, the activity indicator should be only for the webview and I should be able interact with the other view. class FaqViewController: UIViewController, UIWebViewDelegate { @IBOutlet var faqWebView