uiwebview

Why is UIWebView canGoBack=NO in iOS7?

不问归期 提交于 2019-12-28 05:47:04
问题 I'm embedding this web site into my app like this: NSString *url = [NSString stringWithFormat:@"https://mobile.twitter.com/search?q=%@", @"@test OR #test"]; url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [self.twitterWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]]; self.twitterWebView.scalesPageToFit = YES; And I have 2 buttons for going back and forward in this web site. I'm calling [self.twitterWebView goBack]; and [self

UIWebView capturing the response headers

戏子无情 提交于 2019-12-28 05:36:05
问题 I searched/googled a lot but could not get the answer on how to capture HTTP response headers in UIWebview . Say I redirect to user to registration gateway(which is already active) in UIWebview on App Launch and when user finishes the registration, the app should be notified with the successful unique id assigned to the user on registration which is passed back in HTTP Response Headers. Is there any direct way to capture/print the HTTP Response headers using UIWebview ? 回答1: I love the

UITableViewCell With UIWebView Dynamic Height

时光怂恿深爱的人放手 提交于 2019-12-28 04:49:07
问题 I have a table view with cells that have a webView in them, I want the height of the cell to match the height of the webView. This is the code I use: func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("newsCell") as! NewsTableViewCell cell.webView.loadHTMLString("test<br>test<br>test<br>test<br>test<br>test", baseURL: nil) cell.webView.delegate = self var webFrame = cell.webView.frame

WKWebView and NSURLProtocol not working

拜拜、爱过 提交于 2019-12-28 03:24:26
问题 When using the old UIWebView you could catch the requests by implementing a custom NSURLProtocol. I us this to handle requests that requires authentication. I tried the same code and it doesn't work with the new WKWebView but my protocol class isn't called at all. Is someone experiencing the same problem or is there a better way of doing authentication with the WKWebView? Without any modifications I get a 401 response in the decidePolicyForNavigationResponse delegate function. I've also tried

Opening popup links in UIWebView, possible?

[亡魂溺海] 提交于 2019-12-28 02:45:08
问题 I have a UIWebView which I'm using as an embedded browser within my app. I've noticed that links in webpages that open new windows are ignored without any call into my code. I've tried breakpointing on - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType and then selecting a link that would open a popup window, and the breakpoint is never hit. Is there anything I can do to intercept that selection of the

How to autoplay a YouTube video in a UIWebView

﹥>﹥吖頭↗ 提交于 2019-12-27 11:38:48
问题 I have seen a lot of posts in here about this issue, but still couldn't find a perfect answer for this problem. So I have a tableview, and each cell has a play button inside it. When the user tap the play button, I add a UIWebView to this cell, and play a YouTube video. static NSString *youTubeVideoHTML = @"<html>\ <body style=\"margin:0;\">\ <iframe class=\"youtube-player\" type=\"text/html\" width=\"%0.0f\" height=\"%0.0f\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\">\ <

How to determine the content size of a UIWebView?

大城市里の小女人 提交于 2019-12-27 09:02:12
问题 I have a UIWebView with different (single page) content. I'd like to find out the CGSize of the content to resize my parent views appropriately. The obvious -sizeThatFits: unfortunately just returns the current frame size of the webView. 回答1: It turned out that my first guess using -sizeThatFits: was not completely wrong. It seems to work, but only if the frame of the webView is set to a minimal size prior to sending -sizeThatFits: . After that we can correct the wrong frame size by the

How to determine the content size of a UIWebView?

妖精的绣舞 提交于 2019-12-27 09:02:07
问题 I have a UIWebView with different (single page) content. I'd like to find out the CGSize of the content to resize my parent views appropriately. The obvious -sizeThatFits: unfortunately just returns the current frame size of the webView. 回答1: It turned out that my first guess using -sizeThatFits: was not completely wrong. It seems to work, but only if the frame of the webView is set to a minimal size prior to sending -sizeThatFits: . After that we can correct the wrong frame size by the

Drawing overlay view on top of a web view

二次信任 提交于 2019-12-25 18:48:08
问题 I am trying to make an app that can annotate PDFs. What I have done, is add the PDF through a UIWebview, so my main UIViewControllerhas a UIWebView Delegate. What I am trying to do is put my drawing layer, which is a UIView over the top of my PDF view. I have tried setting the background colour to "clearColour" and the opaque property to no, I still get a weird affect. I think the issue might be because of drawing a bitmap onto the UIView, but I would still like some insight, or an example if

Https, uiwebview and export compliance

断了今生、忘了曾经 提交于 2019-12-25 18:22:08
问题 I have some difficulties understanding the Export Compliance regarding to a build I made through xcode. To sum up, I made a responsive website to show with some images and videos. Since Apple doesn't allow an UIwebview that's not SSL I created my site with "let's encrypt". The app I sent as a build is only an UIwebview and nothing else. I'm not sure about the procedure from here since there's a lot back and forth how to manage it. Can somebody guide me in the right direction. Is it necessary