uiwebview

load local HTML file when link is clicked in WebView

…衆ロ難τιáo~ 提交于 2019-12-30 12:54:05
问题 I have a WebView that loads a local HTML file like this: [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test1" ofType:@"html"]isDirectory:NO]]]; What I want is to click a link in the test1 local HTML file and then for the webView to load the test2 local HTML file. How can I do this? 回答1: Like in a regular webpage. Let the link in test 1 point to test2. 回答2: Instead of loading a request, use the - (void)loadHTMLString:(NSString

ebooks reader not capturing embedded font for epub file

岁酱吖の 提交于 2019-12-30 08:24:14
问题 Hy there, I have a problem in my epub reader, it displays all content correctly but it's not capturing the embedded font in the css file. when I run the same file on other readers the embedded font is displayed but when I run the html file on one of the browsers like firefox it shows the same result as my app and it doesn't display the embedded font. Here is a sample html content: <html dir="rtl" xml:lang="ar" lang="ar" xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007

How to get ENTIRE image from UIWebView including offscreen content

ε祈祈猫儿з 提交于 2019-12-30 07:14:08
问题 I have a method I use to get images from a various views in my iOS application for letting users email screens. Most of the screens where I draw are working ok, but when I use this technique with a UIWebView I only get the visible portion of the Screen. Anything off screen is not included in the rendered image. Been digging around here on Stack, but so far nothing I have found works?! Here is the method I currently use: -(NSData *)getImageFromView:(UIView *)view { NSData *pngImg; CGFloat max,

Monotouch + UIWebView = Random Crashes

本小妞迷上赌 提交于 2019-12-30 06:57:11
问题 I'm using the latest stable releases of Mono/Monotouch/MonoDevelop on a iOS 5.0 iPhone and iPad. I have a UIWebView that in the emulator never crashes however randomly on the actual devices it crashes on EXC_BAD_ACCESS. Based on everything I've read with UIWebViews that most likely occurs when the UIWebView gets disposed before it finishes loading. Here is the code I am using in my ViewDidLoad(): var urlAddress = BASE_URL + _page; var nsURL = new NSUrl(urlAddress); var nsURLRequest = new

Loading Local PDF File Into WebView

旧时模样 提交于 2019-12-30 06:55:14
问题 I am attempting to put the following functionality into an iOS app I am writing: Ship a set of PDFs in the resources folder of the project in XCode Copy the PDFs to the app directory Open the PDF in a webview. As far as I can see, the first two steps work ok (I've used FileManager to check fileExistsAtPath after the copy operation). However, the webview is empty, and is erroring out ("the requested URL does not exist on server"). My code for the file open is as follows: NSArray *paths =

loadHTMLString baseURL:nil not working in iOS5

喜你入骨 提交于 2019-12-30 06:45:08
问题 I got a problem with UIWebView. I want to render my own html code in UIWebView. if I use the below code, it's working fine. NSBundle *thisBundle = [NSBundle mainBundle]; NSString *path = [thisBundle pathForResource:@"foo" ofType:@"html"]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [self.webView loadHTMLString:@"foo.html" baseURL:baseURL]; I want to render the html with below code. But it's not working. foo.html contains exactly the same content with the NSString* one. Any hints? Thanks in

Pass a UIWebView request using prepareForSegue

我与影子孤独终老i 提交于 2019-12-30 05:29:10
问题 I 'm new to IOS and Objective C. The scenario is I have 2 buttons, which open (with segue) 2 view controllers containing a UIWebview. I thought is better to do it with 1 UIWebView so I tried to pass the request object of the webvew and use only one webview controller. so I got the wwwBtn (UIButton that opens a site) and fbBtn (UIButton that goes to a Facebook URL) my viewController and the wwwWebViewController which contains th UIWebView. Here is how I did it. The viewController.h file :

iPhone app: avoiding white screen after splash screen. Let splash screen linger, hide it after UIWebview loads? Splash screen not hiding properly

限于喜欢 提交于 2019-12-30 05:21:08
问题 Our goal is simple for an iPhone app: show a splash page then hide it when a UIWebview is ready to show its page. We need the default splash screen to linger until the UIWebview is ready to display. Otherwise, a white screen appears briefly. Unfortunately, the splash screen fails to hide after we make it linger. The default splash screen remains visible, concealing the UIWebview underneath. We understand this may violate Apple guidelines. This is more for a prototype than anything, and we

How to stop UIWebView loading immediately

风流意气都作罢 提交于 2019-12-30 05:12:09
问题 As ios documentation says, [webView stopLoading] method should be used in order to stop webview load task. As far as I see, this methods runs asynchronously, and does NOT stop currently processing load request immediately. However, I need a method which will force webview to immediately stop ongoing task, because loading part blocks the main thread, which could result in flicks on animations. So, is there a way to succeed this? 回答1: This worked for me. if (webText && webText.loading){

Displaying a background image on UIWebView

安稳与你 提交于 2019-12-30 05:05:48
问题 I'm trying to build a native application that for all intents and purposes is HTML/CSS and Javascript. It all works fine, but when the UIWebView loads there's a delay while the DOM is populated, images retrieved etc. Is there anyway to display a background image on the UIWebView, or something behind it? Ideally this will be the same as the splash screen so it doesn't affect the experience of transitioning from slash to app. Thanks Robbie 回答1: I don't believe you want to be setting the