uiwebview

How to set custom font in UIWebView?

非 Y 不嫁゛ 提交于 2019-12-01 09:06:14
I have a font in the resources and I loaded it into a UIFont I want to know how to use this UIFont as the default font for my UIWebView Thanks in advance... kthorat If you are using webpage to display in the WebView Here is what I would do : Create a string with the header of the HTML page add css file or embedded CSS in header Create the body of HTML. Create ending elements of HTML Append all the strings and load WebView from string NSString *bundlepath = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:bundlepath]; [webView loadHTMLString:html baseURL:baseURL];

How to Get HTML tag which seen in UIWebView Screen out of all HTML tag loaded in UIWebView

孤人 提交于 2019-12-01 08:26:20
In my UIWebView I loaded the "Chapter.xhtml" file like this. [webView loadRequest:[NSURLRequest requestWithURL:url]]; and the whole Chapter.xhtml is loaded in webView. I am showing it with some JavaScript logic in the webview. float pageOffset = pageIndex*webView.bounds.size.width; NSString* goTo =[NSString stringWithFormat:@"pageScroll(%f)", pageOffset]; [webView stringByEvaluatingJavaScriptFromString:goTo]; From this the New page will come as the button is pressed but page scrolling manually off in webview. So, if there are four pages with content in the webview, then only one page will come

detect Swipe gesture in UIWebview

孤人 提交于 2019-12-01 08:21:29
I am new to iPhone developer, I made epub reader and loaded each page of epub in my webview What i want to is, when user does right swipe gesture 2nd time then i want to navigate to new page, i do not want to do anything when user does right swipe gesture for first time. UISwipeGestureRecognizer *swipeRight Is there any method something like, if(swipeRight.touch.count > 2) { // do this } Any help will be appriciated. Thanks In Advance ! EDIT -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ float scrollViewHeight = scrollView.frame.size.height; float scrollContentSizeHeight = scrollView

Universal links not working with WKWebView

ε祈祈猫儿з 提交于 2019-12-01 08:07:25
I have web-view based app and other native apps in company. We were using universal links to redirect user to other apps when needed (other apps still support universal links - I can run them by pressing links from Apple Notes app ). We recently made a transition to WKWebView (from UIWebView ), which provides a way better experience. But after the update Universal Links stopped working and we cannot start other apps when user press link inside our app. According to the docs: "Universal links let iOS 9 users open your app when they tap links to your website within WKWebView and UIWebView views

Problem calling a Local HTML File from XCode

限于喜欢 提交于 2019-12-01 08:01:35
问题 Here's my WebView Code: [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]]; Here's my Error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:isDirectory:]: nil string parameter' Can anyone help? It's saying nil string but the NSURL string is index.html My only thought is that perhaps the index file isn't stored correctly.

How to Get HTML tag which seen in UIWebView Screen out of all HTML tag loaded in UIWebView

丶灬走出姿态 提交于 2019-12-01 07:48:45
问题 In my UIWebView I loaded the "Chapter.xhtml" file like this. [webView loadRequest:[NSURLRequest requestWithURL:url]]; and the whole Chapter.xhtml is loaded in webView. I am showing it with some JavaScript logic in the webview. float pageOffset = pageIndex*webView.bounds.size.width; NSString* goTo =[NSString stringWithFormat:@"pageScroll(%f)", pageOffset]; [webView stringByEvaluatingJavaScriptFromString:goTo]; From this the New page will come as the button is pressed but page scrolling

open iBooks from my app

扶醉桌前 提交于 2019-12-01 07:30:06
问题 I have some PDF in my app. I want to provide an option to open those PDF in other third party e-readers app that might be installed on the device, like Stanza and iBooks. Dropbox application has successfully implemented this feature and I can't find any information on how to detect what other e-readers are available on the device or what the custom url scheme is for those apps. Any help would be greatly appreciated. thanks in advance guys. 回答1: iBooks NSString *stringURL = @"itms-books:";

Universal links not working with WKWebView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 06:42:11
问题 I have web-view based app and other native apps in company. We were using universal links to redirect user to other apps when needed (other apps still support universal links - I can run them by pressing links from Apple Notes app ). We recently made a transition to WKWebView (from UIWebView ), which provides a way better experience. But after the update Universal Links stopped working and we cannot start other apps when user press link inside our app. According to the docs: "Universal links

Video playing automatically in UIWebView

限于喜欢 提交于 2019-12-01 06:16:45
Hi I have a webview and when i tried to load the video files in that , it starts playing the video automatically without user intervention. And also the play button is still displayed in webview (video is playing behind that). I am using the following code to load the URL NSURL* url = [NSURL fileURLWithPath:filePath]; NSURLRequest* request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request]; Can you tell me how to disable the play button OR the Video should start playing only after the user taps the play button ?? - (void)videoThumb:(NSString *)urlString frame:(CGRect)frame {

How to set custom font in UIWebView?

不打扰是莪最后的温柔 提交于 2019-12-01 05:59:43
问题 I have a font in the resources and I loaded it into a UIFont I want to know how to use this UIFont as the default font for my UIWebView Thanks in advance... 回答1: If you are using webpage to display in the WebView Here is what I would do : Create a string with the header of the HTML page add css file or embedded CSS in header Create the body of HTML. Create ending elements of HTML Append all the strings and load WebView from string NSString *bundlepath = [[NSBundle mainBundle] bundlePath];