uiwebview

UIWebView and click link

百般思念 提交于 2019-12-10 06:50:13
问题 I know that most likely the answer is very obvious, but I've looked everywhere on the internet and I have not found anything. I use this method to see if the user presses on the WebView -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; { I can assure you that it works. What I want to do is to make different actions according to the id es <a id="hello" href="..."><img src="..." /></a> once the delegate

iOS UIWebView of RSS to look more like Safari and stay inside app

左心房为你撑大大i 提交于 2019-12-10 06:46:29
问题 Im creating an RSS reader app...but I have noticed that UIWebView renders the RSS feed very differently than Safari does. This is the RSS feed... http://www.sigmapi2.org/index.php?option=com_ninjarsssyndicator&feed_id=2&format=raw This is what I want my UIWebView to look like...this is a screenshot from iOS' Mobile Safari NSURL *url = [NSURL URLWithString:@"http://www.sigmapi2.org/index.php?option=com_ninjarsssyndicator&feed_id=1&format=raw"]; NSURLRequest *request = [NSURLRequest

UIWebView和UICollectionViewController

被刻印的时光 ゝ 提交于 2019-12-10 06:00:32
UIWebView和UICollectionViewController的使用 UIWebView UIWebView是iOS内置的浏览器的控件, 可以浏览网页, 打开文档等 .系统自带的Safari浏览器就是通过UIWebView实现的, 能够加载html/htm, pdf, docx, txt等格式的文件. 在iOS7之前, UILabel, UITextFiled 以及 UITextView 都在后台以某种方式使用 WebKit来进行文本布局和渲染. 渲染 : 是CG的最后一道工序, 将所设计内容制作成最终效果图或者动画的过程 . UIWebView的使用 1> 确定要访问的资源 NSURL *url = [NSURL URLWithString : @"http://www.baidu.com"]; 2> 建立网络请求 NSURLRequest *request = [NSURLRequest requestWithURL :url]; 3> UIWebView加载网络请求 [self.webView loadRequest : request]; UIWebView - 实现百度搜索 -(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { NSString *str = searchBar.text;

IOS之禁用UIWebView的默认交互行为

大兔子大兔子 提交于 2019-12-10 06:00:19
UIKit提供UIWebView组件,允许开发者在App中嵌入Web页面。通过UIWebView组件,我们可以在应用中很方便的嵌入HTML页面。在利用IOS原生的组件进行界面开发时,界面UI元素的布局需要我们去一点点的计算,尤其是对于复杂点的图文混排的内容来说,这种计算有时很让人头痛。与原生组件相比,HTML本身的结构性语义性较强,利用CSS能更加方便快捷的进行内容布局和美化,同时Javascript可以为页面添加所需的交互动作和处理逻辑。因此利用HTML/CSS/Javascript在界面上添加那些低交互性纯展示性的内容有时是比较好的选择,虽然这可能增加了学习的成本,但现在基本上每个开发人员都或多或少的学习和使用过这些前台技术,更何况对于那些从传统前端开发转至移动端开发的人员,这些学习成本基本可以忽略不计。 常见默认交互行为 用过UIWebView组件的开发者都知道,当UIWebView加载显示HTML页面时,组件本身提供了一些系统默认的交互行为,这些默认行为包括: 1.长按文本区域显示文字放大镜,选择指定区域的网页内容,包括文字和图片,执行复制,粘贴等 2.长按链接对象呼出弹窗框,执行页面跳转或保存图片等 对于移动终端来说,因缺少PC机下的键盘鼠标,而只是依赖有限的可被识别的那几种手势来进行操作,极大的限制了交互的灵活性。例如我们要保存网页内的某张图片,利用鼠标右键弹出菜单的

iOS

偶尔善良 提交于 2019-12-10 05:52:32
Url编码 、 解码 当url地址中包含有中文字符 或其他非标 准的url字符时,需要对该url地址进行编码 。 NSString提供编码和解码方法 : 编码:stringByAddingPercentEscapesUsingEncoding NSString *urlString=[NSString stringWithFormat:@"http://www.xxxx.com/?param=%@",@"中文"]; urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 解码:stringByReplacingPercentEscapesUsingEncoding NSString *urlStr = [@"xxx" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; UIWebView加载数据3种方法 1.- (void)loadRequest:(NSURLRequest *)request; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *request = [NSURLRequest

iphone:Pop up button in UIWebView

本小妞迷上赌 提交于 2019-12-10 05:08:39
问题 I want to put pop up button like Email in UIWebView.In my app i have created ebook in webView now whenever i click(long press) on index page link it will create the pop up window with open and copy button as shwon as below: Like this i want to put another button like Email and Print.How to create another button in pop up window in WebView?Thanks in advance! 回答1: The popup you refer to is called a UIMenuController . You can access the [UIMenuController sharedMenuController] method to get the

Swift stringByEvaluatingJavaScriptFromString

笑着哭i 提交于 2019-12-10 02:56:19
问题 I try to use some javascript on my WebView with the new stringByEvaluatingJavaScriptFromString function I m not quiet familiar with the syntax so i tried func stringByEvaluatingJavaScriptFromString( "document.documentElement.style.webkitUserSelect='none'": String) -> String? as shown here https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/index.html#//apple_ref/occ/instm/UIWebView/stringByEvaluatingJavaScriptFromString: but i get a error that "Expected '.'

How to find last load of UIWebView(Ready State 4)

不羁岁月 提交于 2019-12-10 02:43:26
问题 I have a problem with the didFinishLoad method in UIWebView that is keeps firing. I want to try the estimatedProgress solution, however I dont know where to find those frameworks unfortunately. I am running Mountain Lion and using the latest version of XCode. Also, for the UIWebView firing multiple times, is this the best way to go or are there new methods. There seems to be a javascript answer on SO, however that did not work for me. That was dated back in 2009, and I hear that Apple rejects

Is there a way to disable the flash/blink on the iPad/iPhone when an onclick is fired?

拈花ヽ惹草 提交于 2019-12-10 02:31:19
问题 So I have an area that has an onclick event. When clicked on a regular browser it does not show any visual change, but when it is clicked on the iPad/iPhone it makes a flash/blink. Is there any way to stop it from doing this on the iPad/iPhone? Here is an example similar to what I am doing: http://jsfiddle.net/zb5xn/. 回答1: Try this: body * { -webkit-tap-highlight-color: rgba(0,0,0,0); } 来源: https://stackoverflow.com/questions/8990442/is-there-a-way-to-disable-the-flash-blink-on-the-ipad

Using the same UIWebView across different viewControllers

杀马特。学长 韩版系。学妹 提交于 2019-12-10 01:26:50
问题 TL;DR: I need to implement a singleton UIWebVIew that's shared across multiple ViewControllers. The question contains all of my approaches so far. appDelegate: @property (strong, nonatomic) UIWebView *singleWebView; firstViewController: @property (weak, nonatomic) IBOutlet UIWebView *webView; - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear: animated]; NSLog(@"Removing webview from the first VC"); [self.webView removeFromSuperview]; self.webView.delegate = nil; AppDelegate