uiwebview

detect Swipe gesture in UIWebview

牧云@^-^@ 提交于 2019-12-01 05:54:53
问题 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 *

Disable UIWebView default scrolling behavior using objective-c

折月煮酒 提交于 2019-12-01 05:47:42
I know you can use a javascript to do this <script type="text/javascript"> touchMove = function(event) { event.preventDefault(); } Is there a way to do the same using objective-c? try this... UIView * v = [[webView subviews] lastObject]; [v setScrollEnabled:NO]; [v bounces:NO]; EDIT: Added checks to original answer based on comment below UIView * v = [[webView subviews] lastObject]; if([v isKindOfClass:[UIScrollView class] ]) { if ([v respondsToSelector:@selector(setScrollEnabled]) { [v setScrollEnabled:NO]; } if ([v respondsToSelector:@selector(bounces)]) { [v bounces:NO]; } } You can also

Search to highlight text in PDF using UIWebView

烂漫一生 提交于 2019-12-01 05:40:09
问题 I am new in ios developement I have UIWebView for displays Pdf page articles from URL. I need to search string or text and highlight.I am not able to search and highlight the text in PDF using UIWebView.Pdf is loading fine but search text is not highlighting. its working only for html I need in PDF Mycode ViewController.h #import <UIKit/UIKit.h> #import "SearchWebView.h" @interface ViewController : UIViewController<UIWebViewDelegate> { IBOutlet SearchWebView *webView1; } @end ViewController.m

UIWebView baseURL and absolute path

喜夏-厌秋 提交于 2019-12-01 05:11:54
I have an HTML page that is constructed like this: <html> <head> <link rel="stylesheet" href="/style.css" /> </head> <body> </body> </html> It is stored in my documents directory: /Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/12345-ID/Documents/mysite/index.html I have also stored the style.css in the documents directory: /Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/12345-ID/Documents/mysite/style.css But now, when I try to load the html into my webview using this: NSURL *test = [NSURL URLWithString:@"file:///Users/username

UIWebBrowserView does not span entire UIWebView

不问归期 提交于 2019-12-01 05:07:09
So I have been trying to get this simple behavior working on my iPhone app now for a while. I have a nav bar at the top and a tab bar at the bottom. I am loading all of my content in a webview, which I want to fit between the two. I have posted about this issue twice already, both here: IOS View still does not load in the correct position and here: Programmatically setting content to fill screen between tab bar and nav controller Currently, my webview looks and performs fine on iPhone 4 and 4s, the issue arises on the 5s. When the screen finishes loading, it looks like the image here: http:/

Video playing automatically in UIWebView

萝らか妹 提交于 2019-12-01 04:53:09
问题 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

How do I make UIWebView show a pdf file from its own app?

不问归期 提交于 2019-12-01 04:34:13
I really need to make a UIWebView open up a specific PDF document that is in my project directory. I can't seem to find any tutorials on this. I found one, but the author was not specific about some of the code. I have to assume it's got to be quite a simple bit of code. Can someone help me code UIWebView to load a PDF? Thanks. Use pathForResource and fileURLWithPath: NSString *path = [[NSBundle mainBundle] pathForResource:@"FileNameHere" ofType:@"pdf"]; NSURL *url = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request]; 来源:

Playing youtube videos on iOS

爱⌒轻易说出口 提交于 2019-12-01 04:20:46
I was wondering how are apps like McTube ( https://itunes.apple.com/us/app/mctube-for-youtube/id559618284?mt=8 ) playing youtube videos. It looks like a custom MPMoviePlayerController but is that allowed? BTW I need autoplay which I couldn't achieve with UIWebView , that's why i was wondering. Some YouTube videos can be played back in a MPMoviePlayerController - some cannot. When you query a video through the YouTube Data API ( link here ) you'll get back all the content types available for a particular videos, including the Flash player, 3GPP, MP4 ( if available ), etc. You can use these URLs

UIWebView phone links detection on iphone

微笑、不失礼 提交于 2019-12-01 04:17:22
there is something strange in my code. I'm sure to forget something but i don't know what. I try to handle phone, sms mailto and http links in an UIWebView. This is how i try : 1/ instantiate the UIWebView : webview = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,320,460)]; webview.opaque = NO; webview.backgroundColor = [UIColor clearColor]; webview.userInteractionEnabled = YES; webview.dataDetectorTypes = UIDataDetectorTypeAll; 2/ set the appropriate delegate : [webview setDelegate: self]; 3/ implement the delegate method (simplified version here) : - (BOOL)webView:(UIWebView *)webView

iPhone UIWebView - How do you set the zoom level and position?

只谈情不闲聊 提交于 2019-12-01 03:33:45
I'm displaying a series of tiled images in a UIWebView and would like to programmatically set the UIWebview's initial zoom and view location. How does one go about doing so? NOTE: this answer is from 2009. Please see one of the better solutions for a more civilized age. Programmatic scrolling of UIScrollView is now a solved problem. I have a detailed discussion of how (and why) UIScrollView zooming works, an example project and ZoomScrollView class that encapsulates the required zooming magic at github.com/andreyvit/ScrollingMadness/ . So probably you should put your images inside UIScrollView