uiwebview

Creating an IPhone Map application

▼魔方 西西 提交于 2019-12-20 15:32:43
问题 How can i create a map application for Iphone . I know that UIwebView can be used to display map . But is there any native API available on IPhone(which the native iphone map application uses)? 回答1: Look at the simple framework from CloudMade: http://developers.cloudmade.com/projects/show/iphone-api I use it in a simple app that I created to locate your position. It's in the App Store under PinDrop in the Navigation section. The framework is really rough, but it worked for what I needed. When

How to add customize HTTP headers in UIWebView request, my UIWebView is based on Cordova project?

落花浮王杯 提交于 2019-12-20 15:28:13
问题 My iOS UIWebView page is based on Cordova open source framework, and I want to add some customize http headers in its webview URL request, my solution is to add them in the following UIWebView delegate method. Debug shows that headers are added successfully, but in fact the request doesn't bring them out. Using Wireshark to capture network packets and found only standard headers are available, no my customize ones. My testing is based on simulator (iOS 7.1), anyone who has experience on this

Hide shortcut keyboard bar for UIWebView in iOS 9

半城伤御伤魂 提交于 2019-12-20 14:06:11
问题 I'm developing PhoneGap application for iOS and I need to get rid of new iOS 9 shortcut bar. Now I'm doing the following in the - (void)viewDidLoad method if ([self.webView respondsToSelector:@selector(inputAssistantItem)]) { UITextInputAssistantItem *inputAssistantItem = [self.webView inputAssistantItem]; inputAssistantItem.leadingBarButtonGroups = @[]; inputAssistantItem.trailingBarButtonGroups = @[]; } This hides undo/redo and copy/paste buttons but shortcut bar still presented on keyboard

Hide keyboard in UIWebView

柔情痞子 提交于 2019-12-20 10:57:58
问题 Is there a way to make a UIWebView dismiss all associated input controls, such as keyboards/pickers? 回答1: Haven't tried it in a web view with a picker, but this definitely works to dismiss the keyboard: [theWebView endEditing:YES]; 回答2: for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows]) for (UIView *keyboard in [keyboardWindow subviews]) if([[keyboard description] hasPrefix:@"<UIFormAssistant"] == YES) { [keyboard removeFromSuperview]; } Dirty way but it works ;) 来源

How does iBooks do this?

妖精的绣舞 提交于 2019-12-20 10:57:14
问题 I am currently displaying text in a uiwebview. However, I would like to allow a user to select text and perform some action with the selected text (google it). Apple has done this sort of thing with iBooks. When you click on a word you can choose to look up the word in a dictionary. How can I do the same thing with Webview? UIMenuController seems to be what I need to look at. But I couldn't find any sample code on how to do this. I'm new to iPhone development please help. 回答1: Starting in iOS

UIWebView Bug: -[UIWebView cut:]: unrecognized selector sent to instance

一笑奈何 提交于 2019-12-20 10:28:47
问题 In the UIWebView , if an input element containing text has focus, and a button is pressed that causes the input to lose focus, then subsequently double-tapping on the input to regain focus and selecting Cut (or Copy or Paste) from the popup bar that appears causes the UIWebView to crash with the error: -[UIWebView cut:]: unrecognized selector sent to instance 0x10900ca60 Demo project: https://github.com/guarani/WebViewDoubleTapTestTests.git I think this must be a UIWebView bug, any ideas? For

Send parameters to a local file in a UIWebView

帅比萌擦擦* 提交于 2019-12-20 09:40:33
问题 I'm working on a native iPhone app. I am able to load a local file index.html into a UIWebView: [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]]; The web loads fine. Now, I would like to load the web with some parameters, in the same way one types this in the browser: URL?var1=myValue&var2=myValue2 So I can get those values inside the javascript of the html file. Is there any way to send

How to clean the content of UIWebView without loading an empty page?

有些话、适合烂在心里 提交于 2019-12-20 09:39:38
问题 I need to clean the content of UIWebView(in order to reuse it), but I have some authentication handling code in its delegate methods, so I do not want to load an empty page like about:blank to clean it, as it will trigger my authentication handling code. So is there a way for doing this? (also, by reusing it, I need to put a spinner on top of the web view, and when it loads another page, I don't want the user see the previous loaded page content, so that's why I need to clean it) Thanks! 回答1:

How to dismiss keyboard on a UIWebView?

我是研究僧i 提交于 2019-12-20 09:25:12
问题 I am loading an HTML page that has a form. I would like to be able to dismiss the keyboard when the user clicks on GO or if he clicks on the SUBMIT button on the HTML page. If the user decides he doesn't want to fill out the form, I also need a way to dismiss the keyboard. Not sure how to do this. 回答1: You can use javascript to take the focus away from the HTML text field using blur: document.foo.bar.myinput.blur(); 回答2: A more concise way without needing to know what element is selected is

Black bar appearing in UIWebview when device orientation changes

大憨熊 提交于 2019-12-20 09:21:56
问题 I have a UIWebView that I am loading onto another view, everthing looks fine in portrait or landscape when rotating, however when I am in portrait and I zoom in slightly with pinch or double tap when I rotate from portrait to landscape the view dosnt fill completely with the uiwebview, there are about 10pxls on the right that turn black as outlined in this screen shot. if you look carefully you can see the outline of the scroll indicator in the black, which segests this is part of the