uiwebview

UIWebView baseURL and absolute path

痴心易碎 提交于 2019-12-01 03:16:23
问题 I have an HTML page that is constructed like this: <html> <head> <link rel="stylesheet" href="/style.css" /> </head> <body> </body> </html> It is stored in my documents directory: /Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/12345-ID/Documents/mysite/index.html I have also stored the style.css in the documents directory: /Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/12345-ID/Documents/mysite/style.css But now, when I try to load

Font sizes in UIWebView does NOT match iOS font size

十年热恋 提交于 2019-12-01 03:10:53
Here's a UILabel which says "About". Set at exactly 17.7 in iOS. Below it a UIWebView which also says "About". Also set at exactly 17.7 using css. They don't match. How to fix this correctly? It is bizarre that in Apple's own UIWebView, the size basis is different ? Html to test... <html><head> <style type='text/css'> body { margin: 0px; font-family: 'SourceSansPro-Light'; font-size: FONTPOINTSpt; } html { -webkit-text-size-adjust:none; } </style></head> <body leftmargin=0 topmargin=0> About </body></html> Behavior is identical on device or simulator. (Note, from here I learned the ratio is,

UIWebBrowserView does not span entire UIWebView

最后都变了- 提交于 2019-12-01 02:45:24
问题 So I have been trying to get this simple behavior working on my iPhone app now for a while. I have a nav bar at the top and a tab bar at the bottom. I am loading all of my content in a webview, which I want to fit between the two. I have posted about this issue twice already, both here: IOS View still does not load in the correct position and here: Programmatically setting content to fill screen between tab bar and nav controller Currently, my webview looks and performs fine on iPhone 4 and

Disable UIWebView default scrolling behavior using objective-c

允我心安 提交于 2019-12-01 02:43:53
问题 I know you can use a javascript to do this <script type="text/javascript"> touchMove = function(event) { event.preventDefault(); } Is there a way to do the same using objective-c? 回答1: try this... UIView * v = [[webView subviews] lastObject]; [v setScrollEnabled:NO]; [v bounces:NO]; EDIT: Added checks to original answer based on comment below UIView * v = [[webView subviews] lastObject]; if([v isKindOfClass:[UIScrollView class] ]) { if ([v respondsToSelector:@selector(setScrollEnabled]) { [v

UIWebView not finishing loading?

随声附和 提交于 2019-12-01 02:19:54
I have a webview in my application.It loads most of the pages and the function webViewDidFinishLoad gets called when the loading finishes.But some of the pages loading doesn't finish although the pages appears to be loaded. In these cases neither - (void)webViewDidFinishLoad:(UIWebView *)webView nor (void)webView:(UIWebView *)webView didFailLoadWithError is getting called. For eg: Go to the site http://www.mynevadacounty.com/ and when you click on any of the items such as mobile the page loading doesn't finish in the UIWebView. What could be the possible cause of this? Edit:Most of these sites

Playing youtube videos on iOS

送分小仙女□ 提交于 2019-12-01 01:16:00
问题 I was wondering how are apps like McTube (https://itunes.apple.com/us/app/mctube-for-youtube/id559618284?mt=8) playing youtube videos. It looks like a custom MPMoviePlayerController but is that allowed? BTW I need autoplay which I couldn't achieve with UIWebView , that's why i was wondering. 回答1: Some YouTube videos can be played back in a MPMoviePlayerController - some cannot. When you query a video through the YouTube Data API (link here) you'll get back all the content types available for

WKWebView showing blank on device, working on simulator

走远了吗. 提交于 2019-12-01 01:14:42
One of the modules of my app is a web site. That web site contains primarily an SVG drawing, with custom shaped buttons (using Raphael.js library) to access other drawings (other html page with svg drawings). If the device is on iOS 7, I use a UIWebView and everything works fine. For iOS 8 devices, I use a WKWebView. I had some issues, some of them resolved by this post . I can see my web site on those simulators (iPhone 5 / iOS 8.0 (12A365) & iPhone 5s / iOS 8.0), but I can't see it on my iPod Touch (5th gen, running iOS 8.0.2). It shows a blank screen. I don't know what to look for. Any idea

Add custom Button with AsyncDisplayKit

与世无争的帅哥 提交于 2019-12-01 01:02:13
I am developing an IOS application. I use Facebook AsyncDisplayKit library. I want to a button in ASNodeCell Bu I got " Variable 'node' is uninitialized when captured by block. How can I add UIButton or UIWebView control in ASNodeCell. Please help me dispatch_queue_t _backgroundContentFetchingQueue; _backgroundContentFetchingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); dispatch_async(_backgroundContentFetchingQueue, ^{ ASDisplayNode *node = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{ UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; [button

UIWebView phone links detection on iphone

牧云@^-^@ 提交于 2019-12-01 00:57:52
问题 there is something strange in my code. I'm sure to forget something but i don't know what. I try to handle phone, sms mailto and http links in an UIWebView. This is how i try : 1/ instantiate the UIWebView : webview = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,320,460)]; webview.opaque = NO; webview.backgroundColor = [UIColor clearColor]; webview.userInteractionEnabled = YES; webview.dataDetectorTypes = UIDataDetectorTypeAll; 2/ set the appropriate delegate : [webview setDelegate: self];

Does WatchKit support html? is there is controller like UIWebview?

流过昼夜 提交于 2019-12-01 00:50:08
Does WatchKit support html? is there is controller like UIWebview ?. My client want to show webpage in a Apple Watch. is this possible ? There's no UIWebView in WatchKit (neither WatchOS 1 nor WatchOS 2 ). However, it's fully possible to work around this: You can load the HTML , pick out the relevant content, and display that in for example a Label . This is however not a smart solution, as the website owners can change its layout and render your app useless until you update it. My suggestion is to send a GET -request to the server and receive the relevant data in JSON -format if they have an