uiwebview

Block main thread until UIWebView finishes loading

风格不统一 提交于 2019-12-24 02:22:27
问题 I'm trying to block the main thread until a UIWebView finishes loading, but calling [NSThread sleepForTimeInterval:] after calling [UIWebView loadRequest:] makes the loading never complete: The webViewDidFinishLoad delegate is called after the sleep finishes. Why is this happening? and How can I block the main thread? I'm calling loadPage from [ViewController willRotateToInterfaceOrientation:] , what I'm trying to do is to prevent the iOS interface to rotate until the webview with the other

Highcharts Backgroundimage for bar graph

守給你的承諾、 提交于 2019-12-24 00:59:45
问题 I want to add a background image to a bar chart using Highcharts and display it in a UIWebView . So far I've been using this little plugin, which is working fine in latest Chrome. However, as soon as I load this into my UIWebView, the image is not displayed. I think this is related to the fact that iOS might not be able to parse the correct path for the image file? Is there another (simpler) way to just add a background-image to a bar chart? In my Highcharts data series color: { pattern:

how to open a itunes link in uiwebview

青春壹個敷衍的年華 提交于 2019-12-24 00:58:57
问题 Is it possible to load a app store link in uiwebview. I have tried to open it in uiwebview but it doesnt load in there. I dont want users to leave my app when they click on the url from my app. Is it possible? Regards Pankaj 回答1: iTunes content does not have an "iTunes Preview" page on mobile - iOS automatically recognizes itunes.apple.com links and opens the store. If you want to keep the user within your app, use SKStoreProductViewController to open the store to a specific piece of content.

windowScriptObject method not found on Objective-C code

心不动则不痛 提交于 2019-12-24 00:56:50
问题 I have an UIWebView with my application and want to call Objective-C method from JavaScript. All documentation and tutorial that I found, I see is just uses the windowScriptObject method, but in my code Xcode says that webView dont have instance method -windowScriptObject . What's wrong? - (void)viewDidLoad { [super viewDidLoad]; UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; NSString *indexPath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@

Disable autoplaying video for UIWebView

故事扮演 提交于 2019-12-24 00:44:40
问题 I have a delegate method but it doesn't help me . Please refer to the method below -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 回答1: What page are you trying to open? UIWebView will NOT auto play any video by default. So if your video dose auto played, it should be some javascript in your HTML let it start to play. Maybe you should check your HTML first. 回答2: You can disable auto playback in the

Restrict UIWebview to certain pages

夙愿已清 提交于 2019-12-24 00:31:47
问题 I am trying to create a simple ipad app with a UIWebview that displays a form that a customer can fill in.. what i want to do is restrict the app so that it only allows the user to navigate to certain addresses.. (i.e. either something that allows the user to go to a specific address.. OR something that checks for specific keywords and allows/blocks them as appropriate..) Could someone please show me how its done.. NB: its basically a googledocs form and i dont want to let the user navigate

ios 6 uiwebview shows background while scrolling a page using jquery scrolltop

倖福魔咒の 提交于 2019-12-24 00:31:38
问题 I have a web page being displayed in a UIWebView that uses jquery scrollTop (using 1.6.4 version of jquery) to scroll the window to a speicified position after the page is loaded. This was working fine with xcode older than 4.5. After I built it using xcode 4.5 the page momentarily shows the background of the UIWebView before scrolling. This happens only in ios6. Has anyone encountered any similar issue with xcode 4.5 and ios6? Is there any new API for UIWebview that I can use to stop this

How to overlay a UIButton (close) button on top of a UIWebView?

喜欢而已 提交于 2019-12-23 21:23:00
问题 I have been looking and trying to solve an issue I have with a UIWebView for iOS. I have a very small app which just loads my website the source code lives at https://github.com/pjuu/iotter. On the site when a user clicks on a posted image it load the image URL in to the web view. This leaves them stranded and unable to get back to other parts of the site. What I want to do is display an (x) button in the top right hand corner (no matter what screen rotation is in use) and have perform the

UIWebview does not display embedded youtube well for iOS 8

最后都变了- 提交于 2019-12-23 20:57:16
问题 I have difficulty to play embed youtube in UIWebview. If I used the default embed format from youtube, it does not show anything in the UIWebview. Just blank. NSString *htmlString = @"<html><body><iframe width=\"420\" height=\"315\" src=\"//www.youtube.com/embed/XNnaxGFO18o?rel=0\" frameborder=\"0\" allowfullscreen></iframe></body></html>"; [self.webView loadHTMLString:htmlString baseURL:nil]; I googled around and found the following code works. NSString* embedHTML = @"\ <html><body style=\

Why are Google search results in UIWebView not triggering webViewDidFinishLoad?

泪湿孤枕 提交于 2019-12-23 20:48:21
问题 This is no doubt a more generic issue regarding web pages, but it is easily demonstrated with Google content. When entering some search criteria on Google's home page the results are not triggering the webViewDidFinishLoad method. The same problem occurs when the coloured Google logo is replaced with some artwork linked to a feature page. I suspect the page is not being fully loaded due to some javascript or ajax code, so is there a way of detecting this? 回答1: This is because Google are using