uiwebview

Cannot open PDF file using UIWebView in iOS8beta5

安稳与你 提交于 2019-12-04 22:46:55
问题 I have working project in which i display pdf file in UIWebView While testing my application in iOS8beta5 with XCode5 , it did not work In log it display failed to find PDF header : '%PDF' not found I create sample application with below code which also have same problem CODE : self.myWebView.delegate = self; NSString *path = [[NSBundle mainBundle] pathForResource:@"201" ofType:@"pdf"]; NSURL *targetURL = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL

UIWebView scaling page so that there is no need for horizontal scrolling

拈花ヽ惹草 提交于 2019-12-04 22:38:59
Is there a way to scale a web page in a UIWebView that maintains the aspect ratio but alleviates the need to scroll horizontally to read an article, for example. Vertical scrolling is fine, I just don't want the user to have to constantly be scrolling back and forth horizontally to read each line of the article. Thanks! Edit: the code I'm using to create the view _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, [[self view] frame].size.width, [[self view] frame].size.height)]; [_webView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; [

_UIFallbackPresentationViewController

谁都会走 提交于 2019-12-04 22:02:20
问题 I keep getting the following error when I dismiss the dictionary that opens from tapping Define on the UIMenuController in a UIWebView on the iPhone:- Unbalanced calls to begin/end appearance transitions for <_UIFallbackPresentationViewController: 0x10ab9640>. And after this error, the UIMenuController stops showing up, in any UIWebView. Any ideas what's going on here? UPDATE: The error actually shows up when the dictionary view is opening, not when dismissing it. UPDATE 2: The error is app

Display local pdf file in UIWebView in iphone

一笑奈何 提交于 2019-12-04 22:00:15
I am display local pdf file in UIWebView but it shows exception in path here is my code NSString*fileName=content_Source; NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:@"pdf"]; NSURL *url = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView setScalesPageToFit:YES]; [webView loadRequest:request] first validate that string and the assign to URL like bellow.. NSString *strURLPath = [self trimString: path]; NSURL *url = [NSURL fileURLWithPath:strURLPath]; use my bellow method... -(NSString*) trimString:(NSString *)theString {

Issues in generating PDF from uiwebview in objective c

心不动则不痛 提交于 2019-12-04 20:53:34
I have open pdf file in uiwebview, add image and text in uiwebview subview.Then i tried created pdf file. Below sample i have used to generate pdf file. Multiple page writing in single page. How can i write sample quality and exact size. Please check screen shots and below source UIGraphicsBeginPDFContextToData( pdfData, CGRectZero, nil ); for (int i = 0; i < 10; i++) { CGRect f = [pdfView frame]; [pdfView setFrame: f]; UIGraphicsBeginPDFPage(); CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGContextTranslateCTM(currentContext, 72, 72); // Translate for 1" margins [[[pdfView

UIWebView inside UIView programmatically

笑着哭i 提交于 2019-12-04 20:50:21
I have a UITableView and I want to add a UIView as a footer. This UIView has a UIWebView and a UIButton . I have the following code: - (void)viewWillAppear:(BOOL)animated { CGRect frame = CGRectMake(10, 0, 280, 400); self.webViewContent = [[UIWebView alloc] initWithFrame:frame]; self.webViewContent.delegate = self; self.webViewContent.hidden = YES; } - (void)webViewDidFinishLoad:(UIWebView *)webView { UIView *viewA = [[UIView alloc] initWithFrame:CGRectMake(webView.bounds.origin.x, webView.bounds.origin.y, webView.bounds.size.width+20, webView.bounds.size.height + firstFrameY)]; viewA

Display UIWebView in custom MonoTouch.Dialog Element

走远了吗. 提交于 2019-12-04 20:42:04
Working on a way to display HTML and RTF content in a custom Element in MonoTouch.Dialog . To get started, I created a new class based on the UIViewElement implementation, with the intention of displaying a UIWebView in a cell ( see UIViewElement code here ). The custom element works, but the contents of the UIWebView is never displayed. Once the text of the UIWebView is loaded, I try to resize it using UIWebView.SizeThatFits . This function always return 0s, even though the width given to it (from the actual UITableViewCell it is displayed in) is non-zero. Is it sufficient to add the

Accessing UIWebView local storage data from native iPhone app

↘锁芯ラ 提交于 2019-12-04 20:33:22
问题 I'm writing a native iPhone app that contains a UIWebView component. This component accesses an internet webapp and the webapp stores data offline using HTML5 local storage. Is it possible to access this local storage data from the native app ? 回答1: I was looking to do something similar to this. In short, the DOM and all elements are not directly accessible. However, you can hack things up to get at the data. What you have to do is inject your own javascript into the downloaded webpage. Then

How to detect the playing state of the audio in UIWebView in iOS?

北城以北 提交于 2019-12-04 20:19:27
I have an UIWebView to load a html web link: http://m.y.qq.com in my iOS app. I don't know how to detect the playing state of the audio in UIWebView. I just need to know whether the audio in UIWebView is playing or not in my iOS app, so that I can do something. I have searched a lot from Stackoverflow and Google, but I can't find a satisfied answer. Can anyone give me some help? You can check if audio is playing with isOtherAudioPlaying So in your UIWebView delegate methods you can use: BOOL isOtherAudioPlaying = [[AVAudioSession sharedInstance] isOtherAudioPlaying]; Jay Doe AVAudioSession has

XCode Prevent UIWebView flashing white screen after Launch Image

荒凉一梦 提交于 2019-12-04 20:11:30
I am fairly new to XCode - I'm designing an app with a single view that just displays a UIWebView that loads my jQuery mobile web site. I have the Default.png and Default@2x.png files for the Launch images in place. When I run the app on my test device or in the emulator, it shows my Launch Image, and then flashes a white screen while the UIWebView loads the first page. I know that I can change the background color and opacity so it will flash a different color than white, but I would like to prevent the flash altogether. I would like the app to launch, show the Launch image, and not show the