uiwebview

Correcting user submitted URL in Xcode/Objective C

天涯浪子 提交于 2019-12-13 08:58:31
问题 I'm trying to programme a mini browser in Xcode however at the moment the UIWebView will only load URLs that include the http ://www The user submits their URL using a UITextField and the contents become a string. I wondered if there was a way to either search the submitted string and add the http or www or both where required or format the text input so it automatically checks to see if the correct address is used. Thanks 回答1: Do something like this: NSString *urlString = ... // the user

UIWebView Payment Processing

梦想的初衷 提交于 2019-12-13 08:45:50
问题 I am implementing a purchasing system for physical items in an app, because it's not digital goods it won't be classed as in-app-purchase. The payment service I need to use don't have a public API. So I was wondering if I can hit their url in a UIWebView and make the payment through there. Will it get accepted in the AppStore? Or will I have to leave my app and go to Safari to finish the transaction? thanks 回答1: Your approach is fine, no need to switch out to safari. Just make sure the url

How to show image while page is loading in swift?

别来无恙 提交于 2019-12-13 08:37:07
问题 I'm beginner in swift and Xcode and want to know how to make an image appears while page finish loading in UIWebView,like when you enter a new website,image start appear on screen in webview 回答1: You can use any loader meanwhile the website loads, like MBProgressHUD or any other progress bar. And if you are willing to show an custom image over a screen while loading then you can handle that in following delegate methods: say you have take any custom image or View called loadingView func

WebView not working correctly on orientation change

橙三吉。 提交于 2019-12-13 08:13:56
问题 I have a Universal app with a webView which resize when an orientation change occurs. On the iPad simulator, the webView automatically reflows to fit the new width. But on the iPhone simulator, the content doesn't reflow and some of it gets cut off. Is this a known WebView Bug ? How do I fix this issue? My webview just loads a remote html page. I am testing on IOS 4.3 回答1: In the interface builder, you have to adjust the properties of the WebView to make it stretch on orientation change. Make

Question about UIWebview when tapping links

牧云@^-^@ 提交于 2019-12-13 08:13:16
问题 I have an UIWebView which loads an html-file. Once the user clicks a link, i want the url to open in a custom UIWebview. I tried some things: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"MyiPadHTML" ofType:@"html"]; NSURL *url = [NSURL fileURLWithPath:htmlPath]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webview loadRequest:request]; } else { NSString *htmlPath = [[NSBundle mainBundle]

UIWebview never rendered and app rejected

强颜欢笑 提交于 2019-12-13 07:55:19
问题 So I have been developing an app that loads all content through a uiwebview and uses a tab bar and navigation bar for the user to traverse the app. Recently I submitted the app to the app store, and it was rejected with the following information. "3.2 Apps with placeholder text will be rejected We found that your app and/or its metadata does not appear to include final content, which is not in compliance with the App Store Review Guidelines. Specifically, your app contains no content and has

UIScrollView subviews contents size issue

和自甴很熟 提交于 2019-12-13 07:35:02
问题 I am using a scrollView, in which i have added some static content in a container view and below this container view i have added a web view and added both these views into my scrollView, I dont want the web view to be scroll, instead I want that my scrollview should scroll according to the height of my container view and height of contents in web view. Note: I am loading contents in webview as html string, that i am receiving from server, The contents are coming in between of html tags and i

How to Get webview from UITableView didselectrowatindexpath?

℡╲_俬逩灬. 提交于 2019-12-13 07:33:00
问题 I have a UITableview in this view i created uiwebview for each cell. When i tap on a cell i want the view of UIWebView. How to achieve this?? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString * CellIdentifier = @"Cell"; UITableViewCell *cell; cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; if(cell == nil) { cell = [[[UITableViewCell alloc]

Cannot open URL in UIWebView in ios 9.0

99封情书 提交于 2019-12-13 07:27:56
问题 I get the following message when i try to open a URL in UIWebView- App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. I already tried the method given here but I get the same error report at the console 回答1: NSAppTransportSecurity add to info.plist , data type is Dictionary, then add an item NSAllowsArbitraryLoads , which is boolean value and set it to YES, then restart the

How do I Setup my UISearchBar connected to my UIWebView to be able to search on google with a word instead of a url using swift

给你一囗甜甜゛ 提交于 2019-12-13 06:53:55
问题 How do I Setup my UISearchBar connected to my UIWebView to be able to search on google with a word instead of a url. For example search apple instead of http://www.apple.com Heres my code so far import UIKit import WebKit class ViewController: UIViewController, UISearchBarDelegate { @IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var webView: UIWebView! func searchBarSearchButtonClicked(searchBar: UISearchBar!) { searchBar.resignFirstResponder() var text = searchBar.text var url =