uiwebview

iOS 6 - UIWebView loadHTMLString not working properly

前提是你 提交于 2019-12-18 13:02:02
问题 If anyone experienced the issue below, please let me know if you were able to find a fix. I've spent a couple of days trying to come up with a solution, but no luck so far. I'm using XCode 4.5 with iOS 6 SDK Golden Master. Basically, my application reads and HTML file and hands its contents to a web view for rendering. NSString *path = [[NSBundle mainBundle] pathForResource:@"filename" ofType:@"html"]; NSString *html = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding

Clearing UIWebView's Cache in Swift

妖精的绣舞 提交于 2019-12-18 13:01:18
问题 I have a UIWebView inside my app. This UIWebView needs to be reloaded fully (i.e. clear all cache of images/HTML/cookies etc.) every time when viewDidLoad . So is there any code I can do this in Swift? Here is my code: let myUrl = NSURL(string: "http://www.example.com") let myRequest = NSURLRequest(URL: myUrl!) myWebView.loadRequest(myRequest) Thanks! 回答1: You can use NSURLCache.sharedURLCache().removeAllCachedResponses() NSURLCache.sharedURLCache().diskCapacity = 0 NSURLCache.sharedURLCache(

UIWebView with just an image that should fit the whole view

帅比萌擦擦* 提交于 2019-12-18 12:41:59
问题 So the issue I'm having now is with UIWebViews displaying a single image. What I'd like is the image to be reduced if it doesn't fit the place, and keep it's original size if not. So here is how I do it (in a UIViewController): - (void)viewDidLoad { [super viewDidLoad]; UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 80)]; NSString *path =[[NSBundle mainBundle] bundlePath]; NSURL *baseUrl =[NSURL fileURLWithPath:path]; NSString *html =

Allow UIWebView to load http://localhost:port/path URIs without an Internet connection

爷,独闯天下 提交于 2019-12-18 12:33:00
问题 I am working on an iPad app which has an embedded HTTP server listening on a high port, and I am loading pages from this HTTP server using a UIWebView . For the functionality of the app, it is important that this works when no network connection is available. The UIWebView is loading URLs of the form http://localhost:port/path When I disable Wi-Fi on my iPad and run the application, the UIWebView ’s delegate gets a webView:didFailLoadWithError: message with the following NSError object: Error

JQuery Mobile not working inside UIWebView

走远了吗. 提交于 2019-12-18 12:26:30
问题 I'm coming here after many many hours of looking for a solution and trying different approaches to fix this issue I'm having with JQuery Mobile and my iPad app. What I'm trying to do is a reporting app with Fusion Charts. I have successfully rendered the charts within web views (UIWebView) using different methods, and following different examples, but what I'd like to do now is accomplishing the same task using the JQuery Mobile framework. I'm not using phonegap and I've followed the steps to

iOS 7 UIWebView not rendering

我的梦境 提交于 2019-12-18 12:07:56
问题 I'm porting my app to iOS 7 and I have a problem with UIWebView in iOS 7. I load local html string in it with this code: NSURL *baseURL = [NSURL fileURLWithPath: DOCUMENTS_DIRECTORY]; [self.descWebView loadHTMLString:html baseURL:baseURL]; It works perfectly on iOS 6 and prior but on iOS 7 it doesn't rendering and the UIWebView is still white. And this message appears in console: void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame

Passing data to objective c with POST rather than GET

落爺英雄遲暮 提交于 2019-12-18 12:04:45
问题 I have been using the url intercept method to pass data from javascript to objective C by passing the data as url encoded parameters and using NSURLProtocol to intercept the request however I am now wanting to send larger amounts of data like say 10,000 character long strings but this does not seem practical to do in a GET request. Right? Is there a way for objective c to intercept POST data sent from a UIWebView? If so do I still use NSURLProtocol and how do I get the POST data? If not is

iOS Objective C - UIWebView AutoFill and Execute

自古美人都是妖i 提交于 2019-12-18 12:03:15
问题 I was wondering is there any possible way that I can have a webview that automatically inputs the values for text boxes on a website and submit so that the user can just bypass the search (in particular search forms) entirely? So the user is only shown the result? An example is : http://www.eatwellguide.org/mobile/ I noticed looking at the source it is using javascript. Is there anyway I can automatically fill those in and press submit without the user even seeing this page. So, the webpage

Cordova + Crosswalk iOS still using UIWebView

冷暖自知 提交于 2019-12-18 12:00:05
问题 I didn't find a lot of instruction setting up crosswalk for iOS it seems like it should be as simple as: cordova plugin add cordova-plugin-crosswalk-webview cordova build ios Because I've had issues with plugins not taking effect before I do the following: cordova plugin add cordova-plugin-crosswalk-webview cordova platform remove ios cordova platform add ios cordova build ios After having done this, when I capture the view hierarchy and inspecting that it's still using "UIWebView" which has

UIWebView won't load links with certificate (https:// prefix)

倾然丶 夕夏残阳落幕 提交于 2019-12-18 11:43:07
问题 I know this has been asked before but I have looked at every answer (there aren't many) and none help me. The issue I am running into is dealing with certificates with my schools e-mail service. The links for the two e-mail services are here: Main school e-mail: https://marauder.millersville.edu/mail/index.pl Computer Science e-mail: https://cs.millersville.edu/cswebmail University student portal (Marauder Mail button on the right doesn't open when clicked in my UIWebView) http://myville