uiwebview

How to load Map view using the WebView Url in iphone

大城市里の小女人 提交于 2019-12-04 05:06:51
问题 I'm loading a mapview using UIWebView by an url like http://www.google.com/maps?saddr=Massachusetts,+United+States&daddr=Sunnyvale,+CA,+United+States. This leads to load a direction view instead of mapview with Direction. Can any one tell me how to load mapview with directionLine from source to destination using the above url? 回答1: Just add &output=embed at the end of your link: http://www.google.com/maps?saddr=Massachusetts,+United+States&daddr=Sunnyvale,+CA,+United+States&output=embed 来源:

how to forward UIWebView scroll to UIScrollView ? (conditionally)

笑着哭i 提交于 2019-12-04 04:45:51
I have a UIWebView inside UIScrollView . This idea is to be able to create more reading space on screen when user scroll the webpage upwards - by scrolling the UIScrollView upwards till the toolbar is visible, and obviously when the toolbars is nomore visible actually scroll the webpage to show more content that's on the page. IPhone Safari browser does exactly the same functionality. see screenshot (first) for default behavior i am getting - i guess because : the scrolling message is consumed by the webview since the touch/scroll is happening directly on webview area. what i would like to do

Allowing location access inside UIWebView

假装没事ソ 提交于 2019-12-04 04:44:27
I have a webview based application and when I access http://maps.google.com , my webview is not passing the location as Safari does. I know CLLocationManager is needed, but do I get a callback when a webpage (maps.google.com) wants access to my device location? How do I respond back with the coordinates to the webpage from my WebView? The webview will start monitoring the location automatically, however since iOS 8 location access requires the NSLocationWhenInUseUsageDescription description in your info plist to be set. If this has been done, it will prompt the user automatically to allow

iOS7 UIWebView - Set content starting position below navigation bar

南楼画角 提交于 2019-12-04 04:15:31
问题 I have a UIViewController designed in a Storyboard (IB) as follows : UIWebView stretched to fill the entire canvas UIWebView has AutoLayout constraints to pin all 4 sides to the edges of the superview UIViewController has all 'Extend Edges' options ticked so UIWebView sits underneath navigation bar UIViewController has 'Adjust Scroll View Insets' unticked UIViewController is loaded within a UINavigationController What I want to happen when the VC loads is for the top of the UIWebView content

Remote image doesn't get displayed in html page displayed in UIWebView

自闭症网瘾萝莉.ら 提交于 2019-12-04 04:07:01
问题 The following code <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=156093464&id=156093462&s=143441"> <img height="15" width="61" alt="Randy Newman - Toy Story - You've Got a Friend In Me" src="http://ax.phobos.apple.com.edgesuite.net/images/ badgeitunes61x15dark.gif"></img> </a> Is from apple's documentation http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/iTunesLinks.html#//apple_ref/doc/uid/TP40007896-SW1 When a html page

UIWebView - white background before loading content

岁酱吖の 提交于 2019-12-04 03:59:38
I have a question. I have a menu, when I click on it, it will load content remotely from URL via UIWebView. When I try on simulator, before loading the content, there's a white background and then loads my HTML Page (which has dark background) Demo: You can see that white flash, when I click on "KALENDER" How can I fix this issue? My UIWebView looks like this: let myWebView:UIWebView = UIWebView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height)) myWebView.loadRequest(NSURLRequest(URL: NSURL(string: "http://website.com/test.html")!)) self.view

sourcing local javascript in uiwebview ios

旧巷老猫 提交于 2019-12-04 03:55:28
------------------NOTICE---------------- Sorry guys, made a stupid mistake, I had found this fix already: https://devforums.apple.com/message/32282 Which works, but didn't realise that the target location had changed in the newer versions of Xcode, so instead clicked on the project file at the top of the list on the left, and found my way to Copy Bundle Resources that way. Not sure why everything but the js shows up there by default, but dragging the files there from the list on the left fixed my problem! I'm programming an app for ios in html in a uiwebview (a book app) and using jquery and

How to enable “select all” in UIWebView in an IPhone App?

狂风中的少年 提交于 2019-12-04 03:54:55
问题 I am writing an IPhone application which embeds a UIWebView. There are various safari like features like navigation, etc. One of the tasks I am looking for is to present a "select all" option when the user selects on a piece of text on the web view. Currently, I only see a "copy" option. Is there an easy way to enable the "select all" menu item? I have ofcourse tried adding a menu item to the shared menu controller but that doesn't necessarily implement the original safari "select all"

NSURLProtocol canInitWithRequest: called multiple times

假如想象 提交于 2019-12-04 03:37:52
Our app has a lot of web views in it and I recently added a NSURLProtocol to interceptor some of the requests from them. I've noticed that some of the web views are calling the +[NSURLPRotocol canInitWithRequest:] method multiple times with what appears to be exactly the same request. Sometimes 6 or 7 times. I'm trying to figure out why this might be occurring. Does anyone have any experience with this? I've logged out the [NSURL absoluteString] and httpMethod values and they are the same for each request. I would expect that this method would only be called once for any given file or resource

UIWebview full screen size

纵饮孤独 提交于 2019-12-04 03:30:46
I am trying to display a pdf in a UIWebview using the entire screen of the device, except the status bar and top bar. So far, I created IBOutlet UIWebview *webview; in my .h file. I connected the webview in my storyboard and wrote the following code in my .m file: - (void)viewDidLoad { [super viewDidLoad]; webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)]; webview.scalesPageToFit = YES; webview.autoresizesSubviews = YES; webview.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth); [webview setBackgroundColor:[UIColor clearColor]]; NSString