uiwebview

Getting selected elements programmatically from uiwebview?

别来无恙 提交于 2019-12-22 06:47:41
问题 Currently I am taking this sample website and showing in my webview. The webpage is displaying correctly. Now I am trying to figure out which data is selected once the user has tapped on the uiwebview. For this I am able to get the CGPoint for the tap by using UITapGestureRecognizer . -(void)singleTap:(UIGestureRecognizer *)gestureRecognizer { CGPoint touchPoint = [gestureRecognizer locationInView:myWebView]; NSString *js = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f)

Properly force or allow Landscape mode for Youtube embedded video in iOS 8 without NSNotificationCenter

血红的双手。 提交于 2019-12-22 06:39:12
问题 I am having issues of capturing when the youtube player will enter in fullscreen or exit fullscreen in iOS 8 because these notifications were removed UIMoviePlayerControllerDidEnterFullscreenNotification and UIMoviePlayerControllerWillExitFullscreenNotification for this version OS version. Because my app project is set to be only in portrait mode the video won't rotate to landscape mode when is playing which is really not too user friendly when watching a video on your device. Usually the

Swipe Gesture Recognition Inside UIWebView

天大地大妈咪最大 提交于 2019-12-22 05:49:14
问题 I have read a bunch of questions on this but none of them seem to achieve what I am looking for... So lets say I have an arbitrary UIWebView inside of a UIViewController . The UIViewController has a SwipeGestureRecognizer that works fine. It even works within the UIWebView -- whenever there is no scrollbar. (Before I load a page or even if I load a page that can fit appropriately within the size of my UIWebView ). However, if I load a webpage that requires horizontal scrolling left or right,

UITableView's, UIWebViews and the scrollsToTop Property = Trouble

筅森魡賤 提交于 2019-12-22 05:49:11
问题 My app has a UITableView . That UITableView has a header view, which is a UIWebView . By default, scroll views have their scrollsToTop property set to YES , which will enable the user to tap the status bar to scroll to the top of the scroll view. When there are two scroll views embedded in one view, that both have their scrollsToTop property set to YES , tapping the status bar does nothing. The solution is to set one of the scrollsToTop properties to NO . That re-enables tapping the status

Is Javascript an “other executable code” for iOS?

只愿长相守 提交于 2019-12-22 05:40:10
问题 In Apple's guidelines, I saw: 2.7 Apps that download code in any way or form will be rejected 2.8 Apps that install or launch other executable code will be rejected What I'm trying to do now is to provide a TextView that allows the users to enter Javascript and run in UIWebView by stringByEvaluatingJavaScriptFromString: So I'm not ' downloading ' any code, and Javascript is not something ' other ' but part of the UIWebView's features. In some ways, its just like running a regular UGC WebApp

Loading the content of a UIWebView before displaying it

孤街醉人 提交于 2019-12-22 05:18:09
问题 I have a set number of ViewControllers in my app. They are allocated and initialized at application launch and released at exit. They are used by a NavigationController to be pushed/popped. In these ViewControllers there are WebViews (actually there is nothing else). My problem is : When I want to change de content (URL) of a WebView that is not on the current TopViewController, the content isn't loaded until I push/pop the associated ViewController. And the transition us "ugly". The pushed

UIWebView doesn't load images from protocol-relative URL

醉酒当歌 提交于 2019-12-22 05:17:33
问题 Make an app with UIWebView which open a webpage with protocol-relative styles & images, such as <img src="//example.com/image.png"> (examples for http or https). Override the page loading process via your custom NSURLConnection , this way. Result: it won't display the images! Though, Safari and other browsers show them correctly... 回答1: I inspected the page opened in WebView and saw weird requests there. They looked like regular URLs, but with applewebdata scheme, e.g. applewebdata://art-u1

UIWebView links opening in Safari

核能气质少年 提交于 2019-12-22 05:13:20
问题 I want to open an iTunes link in my webView, but when the webView launches the page, it redirects to the Safari browser. There, the url is getting opened, but I want it to open in my webView. - (void)viewDidLoad { NSString *urlAddress = @"http://itunes.apple.com/us/app/foodcheck-traffic-light-nutrition/id386368933?mt=8"; //Create a URL object. NSURL *url = [NSURL URLWithString:urlAddress]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in

Memory leak with UIWebView

天涯浪子 提交于 2019-12-22 04:59:15
问题 My project is a hybrid static lib for showing a UIWebView with some JS to control the logic. When I use 64bit and run demo on iOS 8/iPhone 6, the memory keeps going to 30M or more! When I use generation in instrument, the increased memory usage is almost all from webcore; does it means there are leaks in JS code? I can't find a leak when I use Safari to run similar JS directly. When I release the UIWebView, the memory is still not freed; I tested with instrument allocation. There are some

How to show UIWebView's scroll indicators

女生的网名这么多〃 提交于 2019-12-22 04:16:12
问题 I have a UIWebView with some content and I need to make its scroll indicator visible for a short time (like [UIScrollView flashScrollIndicators] ). Any idea how to do this? 回答1: Starting iOS 5.0 onwards, one can now customize the scrolling behavior of UIWebView by accessing the 'scrollview' property to achieve the desired functionality: [webView.scrollView flashScrollIndicators]; 回答2: There's no real way of doing this via a published API, however I think that in this case it's OK to guess the