uiwebview

How to prevent UIwebView refreshing?

时光总嘲笑我的痴心妄想 提交于 2019-12-02 10:04:46
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"]; NSURL *url = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:url]

setStart and setEnd throwing error when trying to programmatically select text in UIWebView

跟風遠走 提交于 2019-12-02 10:03:53
Here is some HTML that I am working with in my UIWebView: <div id = "1"> <span style = "background-color:red"> <a href = "10&20"> This is a link </a> </span> </div> Once the link is tapped, I want to programmatically select the link text in the UIWebView (so "This is a link" would now be highlighted with the blue iOS text selection tool). This is why I am sending some range information in the href of the a tag. This is the call I am using to try and make this programmatic selection: //set content editable true [self.webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@

UIWebView Xhmtl parse error but safari don't

[亡魂溺海] 提交于 2019-12-02 09:40:45
问题 I have an application showing standard html pages. I use UIWebView for html. When using safari for pages no problem. When I use uiwebview the page does not load. Error message(UIWebView) This page contains the following errors: error on line 230 at column 33: AttValue: " or ' expected Below is rendering of the page up to the first error Different page different xhtml error. I realased that ipad simulator load page properly too. 回答1: I had a similar issue. I resolved it by explicitly setting

UIWebView gets cleared after dismissing a fullscreen modal

。_饼干妹妹 提交于 2019-12-02 09:16:15
I have a UIWebView which loads a html string on viewDidLoad. It detects if the user clicks a link and display a modal view, but when i close the modal view the UIWebView's html has gone! If i use a FormSheet Modal Style the content stays behind, its only fullscreen modals that cause this. Obviously i can just input the html string again on viewWillAppear which fixes it but this causes makes the content flick back on which i don't want. heres my code: -(void)viewDidLoad { [self loadArticleText]; ... } -(void)loadArticleText { NSString *htmlHead = @"<html><head>..."; NSString *htmlFoot = @"<

How do I save the contents of a UIWebView as an image

落爺英雄遲暮 提交于 2019-12-02 09:15:36
I want to save the content of UIWebView as an image. The code I have only saves the content of the webpage that is visible on the screen. - (IBAction)saveImage:(id)sender { UIGraphicsBeginImageContext(webCanvas.frame.size); [self.webCanvas.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage =UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil,nil,nil); } I want it so it will save the whole webpage in the UIWebView including the part of the website that is not visible on screen. Is this possible? Piyush

how to pass local html files using array in xcode

馋奶兔 提交于 2019-12-02 09:10:51
here i am trying for a application, when i click on the table view it will redirect to another page called details. there I have used a webview to dispaly the selected url value. here is my code -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:YES]; self.navigationItem.title=@"sample"; servicesArray=[[NSMutableArray alloc]init]; [servicesArray addObject:@"1"]; [servicesArray addObject:@"2"]; [servicesArray addObject:@"3"]; urlsArray=[[NSMutableArray alloc]init]; [urlsArray addObject:@"http://www.google.com"]; [urlsArray addObject:@"http://www.yahoo.com"]; [urlsArray addObject:@"http

UIWebView 横竖屏尺寸不正确问题解决

ぐ巨炮叔叔 提交于 2019-12-02 09:07:57
今天发现ios中,UIWebview 从横屏到竖屏出现界面尺寸不正确,从竖屏到横屏就没有问题。 经过google后,发现了一个比较好的解决方法。 在UIWebview加载的html页面中加入如下标签: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"/> content=width=device-width 是将页面尺寸设置成当前设备宽度,也可以手动设置成其他宽度。 user-scalable 是控制页面能否让用户进行缩放控制。 加上以上标签就可以解决横竖屏尺寸不正确的情况。 来源: oschina 链接: https://my.oschina.net/u/566401/blog/82082

page turn Animation on UIWebView in iPhone

笑着哭i 提交于 2019-12-02 08:40:12
问题 I am new to iPad developer, I'm using UIWebView on the iPhone to display EPUB content, but I want to implement page turning animation similar to book. I had seen many demos of page turn effects, but they all are related to view not UIWebView , for eg: see demo I want to implement this page turn effect. on UIWebView would this be possible? or Should I stop dreaming. Thanks In Advance ! 回答1: see this tutorial http://www.techotopia.com/index.php/An_Example_iOS_5_iPhone_UIPageViewController

Identify submit button click of UIWebview

耗尽温柔 提交于 2019-12-02 08:18:08
问题 I have a UIWebView page with multiple button . Need to identify which button is clicked of the UIWebView. Page source for UIWebview load contents: <form action="settings_personal.php" data-ajax="false" method="post"> <input type="submit" name ="btn_settings_personal" value=" Goals (Personal data) " data-icon="star" data-theme="g" /> </form> <form action="settings_global.php" data-ajax="false" method="post"> <input type="submit" name ="btn_settings_global" value=" Settings " data-icon="gear"

setKeyboardAppearance for UIWebView

那年仲夏 提交于 2019-12-02 08:12:33
问题 It is well know that the keyboard appearance of UITextView and UITextField can be set as following : [self.textField setKeyboardAppearance:UIKeyboardAppearanceAlert]; But how could we set the keyboard appearance of a UIWebView ? Actually, here im using ckeditor for HMTL editing. 回答1: Unfortunately, you can not set the keyboard appearance for a UIWebView using Apple's UIKit APIs. You can however specify the input type using html tags like so: <input type="text" size="30" autocorrect="off"