uiwebview

UIWebView, goBack accessing back-forward list?

浪尽此生 提交于 2020-01-07 05:32:05
问题 I am just having a quick look at UIWebView and have written a small browser with a back button, a UITextField and a forward button. Here is what happens: I enter "www.google.com" into the textField and it goes to the page. The textField says "www.google.com" I enter "www.apple.com" and it goes to the page. The textField says "www.apple.com" I tap the back button and return to "www.google.com" The textField still says "www.apple.com" I have added: -(IBAction)myGoBack { NSLog(@"myGoBack ...");

Fade bottom of UIWebView using CSS

百般思念 提交于 2020-01-07 05:21:08
问题 I'm trying fade out the bottom of the UIWebView in my detailView. It's more like fading last 20-40 px. I'm using CSSTricks code for "ReadMoreFade" (link). My simplified version is pasted below. My problem is when I start scrolling in my UIWebView, faded area stays there like a block. I'm attaching a screenshot that shows this. Any suggestions or hints? Thank you. SCREENSHOT: http://i51.tinypic.com/2rmxsfp.png <!DOCTYPE html> <html> <head> <title>Fade bottom</title> <style> body{background:

Unable to display URL in WebView from another view controller

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-07 04:55:14
问题 I have a UITableViewController that needs to open a web view. In my function I have: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { LinkViewController *linkViewController = [[LinkViewController alloc] initWithNibName:@"LinkViewController_iPhone" bundle:nil]; [linkViewController.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]]; [self.navigationController pushViewController:linkViewController

Loading current geolocation on UIWebView

≡放荡痞女 提交于 2020-01-07 04:33:31
问题 Is there a way where I can get the current geographic location of the user (In my case, Bengluru, India), so that I can call Google Static Map API and load the static map image on the UIWebView of the ViewController.xib For example, http://maps.googleapis.com/maps/api/staticmap?center=-OBTAINED_LOCATION-&zoom=14&size=512x512&maptype=roadmap&sensor=false Here OBTAINED_LOCATION should be the one that indicates current geographic location of the user. 回答1: User Following Code: First access

How to request the desktop version of a webpage in Swift 2

落花浮王杯 提交于 2020-01-07 03:53:07
问题 I've tried to request the desktop version of a webpage in this way but it doesn't work and I can't find anything on the web to help me let url = NSURL(string: "*****") let request = NSMutableURLRequest(URL: url!) let newUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.6 Safari/537.11" request.setValue(newUserAgent, forHTTPHeaderField: "User_Agent") webView.loadRequest(request) Could you please help me? 来源: https:/

Enable/Disable button using webViewDidFinishLoad

纵饮孤独 提交于 2020-01-07 02:33:23
问题 I'm working on an iOS app, and I need to prevent a UIButton from being usable until the page has finished loading (it uses resources that might not be on the page until it has loaded completely). Right now, I've disabled the button in Interface Builder and am trying to use setEnabled in the webViewDidFinishLoad function. Here's what it looks like: - (void)webViewDidFinishLoad:(UIWebView *)webView { [activityIndicator stopAnimating]; [randomButton setEnabled:YES]; } The activityIndicator stops

UIWebView throwing NSUnknownKeyException iPad

萝らか妹 提交于 2020-01-06 22:43:07
问题 I have a tab bar application. Everything works normally, and I can switch between tabs fine and everything, except when I switch to my second tab ProductViewClass the view doesn't update and it spits out the console output below. I have nothing in this view except for a UIWebView and a UILabel. When I delete the UIWebView it runs successfully, and when I add another it still works. It only stops working when I connect the IBOutlet from my File's Owner to the UIWebView. Besides synthesizing

iOS - Debug WKWebView and/or UIWebView from iPhone via Macbook

≡放荡痞女 提交于 2020-01-06 19:55:29
问题 Just to clarify before I ask the question, I am not the developer of this app. My company is building an iOS app and I have the app installed on an iPhone but there are issues that are happening in the WKWebView that aren't happening in Safari or any other browser so I want to be able to debug the HTML and CSS if possible without having to install XCode and run a simulation. Is this possible? I've searched online and tried to find a solution to this, but couldn't find anything useful so my

NSFilemanager uploads new file, but UIWebView shows cached version

耗尽温柔 提交于 2020-01-06 15:41:17
问题 An app I'm building needs to periodically check a known location for an updated file. It happens to be a PDF. If x amount of time has passed, the app needs to upload a new copy of the file. The following code snippet works. It downloads the file. But the app displays a cached version of the PDF instead of the new one. I confirmed this by looking in the app bundle. After this code runs, there is definitely a new file in the Documents directory. But in the bundle's tmp/DiskImageCache-[random

NSFilemanager uploads new file, but UIWebView shows cached version

旧巷老猫 提交于 2020-01-06 15:41:09
问题 An app I'm building needs to periodically check a known location for an updated file. It happens to be a PDF. If x amount of time has passed, the app needs to upload a new copy of the file. The following code snippet works. It downloads the file. But the app displays a cached version of the PDF instead of the new one. I confirmed this by looking in the app bundle. After this code runs, there is definitely a new file in the Documents directory. But in the bundle's tmp/DiskImageCache-[random