uiwebview

embedding google maps in UIWebView without asking for location permissions and showing the google panel

家住魔仙堡 提交于 2019-12-12 03:56:58
问题 I'm using google maps loaded in a UIWebView to display direction between 2 locations here's the url I'm loading in the UIWebView NSString *routeString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f&output=embed",[myData.myLat doubleValue],[myData.myLng doubleValue],[view.annotation coordinate].latitude,[view.annotation coordinate].longitude]; when I remove the output=ember parameter the google panel is displayed but the UIWebView asks for permission to get

how to get correct hight when we have some content on UIWebView in swift iOS?

给你一囗甜甜゛ 提交于 2019-12-12 03:42:33
问题 I have disqusView(link) in UIWebView, I want to scroll webView as the size of disqusView, I don't want default scroll of webView here is my code, in these I'm getting more height then actual height of webView content size. func webViewDidFinishLoad(webView: UIWebView) { let cgfloat = web_discus.scrollView.contentSize.height as CGFloat } or web_discus.stringByEvaluatingJavaScriptFromString("document.hight")! as String but both give more height then actual that`s why it show more blank space

PHP cookie is not staying set in uiwebview

故事扮演 提交于 2019-12-12 03:23:50
问题 I have a UIWebView which has a login. The login is a PHP script and has a setcookie() function. The cookies are set when I login (in the webview) but when I close out the app (with the webview) and reopen it. The PHP cookies get unset and I must login again. Here's the PHP code setcookie($_SESSION['id'], $_SESSION['user_name'], time() + (86400 * 3), "/"); setcookie($_SESSION['pro_pic'], $_SESSION['status'], time() + (86400 * 3), "/"); setcookie($_SESSION['pro_pic'], $_SESSION['email'], time()

Hide content on a UIWebView

时光怂恿深爱的人放手 提交于 2019-12-12 03:17:05
问题 I'm working on an application for iOS in Xcode, i want to hide some content of my page and keep only the center of it. E.g : http://imageshack.com/a/img661/8407/X5KuuN.png. If it's too complicate to hide contents, it would be enough to force the page to be at the center, in the middle of the page (user can't move the page and the page will load in the center). Thanks for help. 回答1: You can remove/modify the unwanted DOM elements by "injecting" javascript at webViewDidFinishLoad stage with

How to Stop UIWebView from “bouncing” vertically scrolling bottom?

一个人想着一个人 提交于 2019-12-12 02:49:13
问题 My question is the same as this question, but has one difference. When I scroll to top refresh my website, I want stop bouncing only to the end of the bottom scroll. How do I do this? 回答1: You can try like this : override func viewDidLoad() { super.viewDidLoad() webview.scrollView.delegate = self } func scrollViewDidScroll(scrollView: UIScrollView) { if (scrollView.contentOffset.y >= scrollView.contentSize.height - scrollView.frame.size.height) { scrollView.setContentOffset(CGPointMake

IOS9 and uiwebview issues?

你。 提交于 2019-12-12 02:46:21
问题 I have webview working fine for version less then ios9, but seems not working for ios9, and its shows me a blank page, but the url is passed. 回答1: To configure a per-domain exception so that your app can connect to a non-secure (or non TLSv1.2-enabled secure host), add these keys to your Info.plist (and note that Xcode doesn’t currently auto-complete these keys as of the first Xcode 7 beta seed): <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>yourserver.com

iPhone scroll-wheel picker for <select> menus

血红的双手。 提交于 2019-12-12 02:45:24
问题 I'm developing a UIWebView iPhone app and mobile website and within the app I have many <select> menus that contain 100+ items each! I was wondering if there is a way to break the <select> menu into submenus in order to make it easier for iPhone users to make selections, ex: I have this for my database setup: | Subcategory | Food | -------------------------------------- |eggs and cheese |scrambled | |breakfast cereal |frosted flakes | |breakfast cereal |mini wheats | |breakfast cereal

Load .epub content to UIWebview with only Horizontal scrolling

故事扮演 提交于 2019-12-12 02:33:37
问题 Currently I'm working on to display Epub content in UIWebview . From this link I have downloaded one sample app for Epub which fulfills all my needs except one thing that is, need to scroll the webview horizontally instead of vertical scroll. Anyone please help me out to do this. 回答1: that mean you need to make a pagination for the html content .. this done by some java script functions .. there is already uploaded open source files to do this .. just google it :). 来源: https://stackoverflow

iOS WebView > Display only main-content from a website including pictures

天涯浪子 提交于 2019-12-12 02:27:49
问题 How do I fetch just the main-content part of a webpage and display it in an UIWEBVIEW? Link to the page When I look at the code of the webpage I see that the 'What is new?' posts appear below: <div id="content-header" class="clearfix"> <a name="main-content" id="main-content"></a> <h1 class="title">Aktuell</h1> </div> <!-- /#content-header --> Is it possible to relate to id="main-content within the UIWEBVIEW to display just this part of the website instead of the whole page? Screenshot shows

Load text+pdf file in uiwebview

别等时光非礼了梦想. 提交于 2019-12-12 02:06:16
问题 I want to show some text and pdf file in a webview at a time. is there any possibility.. i had tried using NSString *htmlString = [NSString stringWithFormat:@"<p>some text which i need to show above pdf</p><img src=\"file://%@\">",@"FR.pdf"]; NSString *bundleP = [[NSBundle mainBundle] resourcePath]; NSURL *fileURL = [NSURL fileURLWithPath:bundleP]; [pdfWebView loadHTMLString:htmlString baseURL:fileURL]; This shows the text and only the first page of pdf file,.. Thanks in advance 回答1: Use