uiwebview

iPhone UIWebView slow loading to local HTML files

Deadly 提交于 2019-12-31 08:56:52
问题 I'm developing an app that requires caching web pages (completely) along with their CSS files and images after saving the entire HTML of the page (going through the links to store each file along with the HTML file). While viewing the HTML file offline, UIWebView takes a long time to load the page, given that I'm already offline, and the file is on disk along with its CSS and images. I'm using this code to load the file: NSData *htmlData = [NSData dataWithContentsOfFile:htmlFilePath]; [wView

Displaying Lots Of RichText : Choosing the best option

拜拜、爱过 提交于 2019-12-31 08:51:28
问题 What is the best way to display lots of RichText (HTML formatted) At the moment I'm working on an app for a forum. As you'd expect the posts on the site have lots of HTML formatting, lists, images bold text , colored text, etc... Now there are several options I can think of (non of them ideal, please if you think of any other options post them in the comments): Custom Cells using NSAttributedString+HTML + DTAttributedTextView for each post? Problems: I used the NSAttributedString+HTML

Activity indicator with custom image

纵然是瞬间 提交于 2019-12-31 08:49:29
问题 I am loading a UIWebView and in the meantime I wan't to show a blank page with this activity indicator spinning (siri activity indicator). From what I have understand you can not change the image, but can't I use that image and create an animation with it rotating 360° and looping? Or will that drain the battery? something like this?: - (void)webViewDidStartLoad:(UIWebView *)webView { //set up animation [self.view addSubview:self.loadingImage]; //start animation } - (void)webViewDidFinishLoad

How to prevent UIwebView refreshing?

给你一囗甜甜゛ 提交于 2019-12-31 07:02:45
问题 I have made an app that contains a lot of PDF files that are loaded in the UIwebview. Whenever I open the PDF, close it, and then go back to it, the file starts from the top again, it reloads. I don't want it to reload once the user goes out of the file and comes back to it. Example of my code is below. (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSString *path = [[NSBundle mainBundle] pathForResource:@"HnonC" ofType:@"pdf"

How to prevent UIwebView refreshing?

孤街浪徒 提交于 2019-12-31 07:02:04
问题 I have made an app that contains a lot of PDF files that are loaded in the UIwebview. Whenever I open the PDF, close it, and then go back to it, the file starts from the top again, it reloads. I don't want it to reload once the user goes out of the file and comes back to it. Example of my code is below. (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSString *path = [[NSBundle mainBundle] pathForResource:@"HnonC" ofType:@"pdf"

How to disable popup menu items like Select, Select All, Suggest…, Define (on UIWebView)?

风流意气都作罢 提交于 2019-12-31 03:59:34
问题 How to disable popup menu items like Select , Select All , Suggest... , Define (on UIWebView )? I have found the following information on the help but don't understand how to use it: For the editing menu commands, this is the shared UIApplication object. Depending on the context, you can query the sender for information to help you determine whether a command should be enabled. 回答1: Swizzle the following method: #import "NSObject+myCanPerformAction.h" @implementation NSObject

Show alert view when click on a link

给你一囗甜甜゛ 提交于 2019-12-31 03:06:14
问题 I use formatted text in UIWebView, i have something like this: <a href="tel://0442059840">0442059840</a> I need to show alert to the user when clicking on that link using the UIAlertView for confirmation before launching the telephone call. Is this possible? Thanx in advance. 回答1: Yes but you need to use undocumented method for this. Search on google or stackoverflow you will find it easily. Here is a link for helping you. http://dblog.com.au/iphone-development/iphone-sdk-tip-firing-custom

How to reference HTML anchor?

雨燕双飞 提交于 2019-12-31 01:43:54
问题 I'm loading a string of HTML into a UIWebView through loadHTMLString. It produces a very long webpage. Once that string is loaded, I need to navigate to an HTML anchor tag with its "name" attribute set. In the HTML, I might have: //3 pages of text here <a name="go here"></a> lots more text here //another 3 pages of text here I need the webpage to scroll down to "go here" once loaded. The mappings work fine if a user clicks a link inside of the webpage and it loads an external URL. But in this

How to show a GIF on iOS in a certain frame, not show it until fully loaded, and allow zoom?

萝らか妹 提交于 2019-12-30 19:58:32
问题 When a user selects a GIF, I want to present an overlay on top of everything showing the GIF. I know there's a few ways on iOS to do this. There's the great UIImage+animatedGIF which works decently well, but for longer GIFs they're very slow and don't play back at the same speed as a UIWebView would (which plays at the accurate playback speed). It sucks, because if that category didn't play them back slowly it would do everything I need. But it doesn't, so I tried with UIWebView, however I'm

NSCachedURLResponse returns object, but UIWebView does not interprets content

夙愿已清 提交于 2019-12-30 17:35:20
问题 I am sending a request to a UIWebView. There are AJAX-calls on the loaded webpage. I need to analyze the AJAX-traffic in order to determinate, if the user is logged in or not. For doing this I installed a NSURLCache in the AppDelegate: MYURLCache *cache = [[MYURLCache alloc] init]; [NSURLCache setSharedURLCache:cache]; This MYURLCache-class correctly receives the traffic that runs through the webview. I can terminate the AJAX-calls only. I then spawn an own request of the AJAX-calls. This one