uiwebview

Knowing when a YouTube video starts playing from within a UIWebView

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 02:48:33
问题 I have made a class that plays YouTube videos (thanks to the help from the kind people of this site). Now I am wondering how I find out when a YouTube video starts playing. I want to know this so I can show a "Please Wait, Loading..." indicator in-between the video being told to play and it actually playing. I start the video playing using stringByEvaluatingJavaScriptFromString: , and of course there is a slight delay between me firing off the javascript command to get the video playing and

How to incorporate youtube into iPhone app?

岁酱吖の 提交于 2019-12-05 02:42:47
问题 I have an iPhone app and I want one view to push to a UIWebView maybe that shows search results of youtube videos for a particular search term. Then I want the user to be able to select the video and play it in app. I've looked at the youtube tutorials but can't seem to get a good grasp as to how to do this. 回答1: Here is a method I use in a view controller with a UIWebView : - (void)embedYouTubeWithURLString:(NSString *)urlStr { CGFloat w = webView.frame.size.width; CGFloat h = webView.frame

uimenucontroller in uiwebview with custom menu items without MORE menu

安稳与你 提交于 2019-12-05 02:27:57
问题 In my iPad app, there is a UIWebview that displays text content. When I tap hold and select a text, a menu should popup with 2 custom menu. say, | MENU1 | MENU2 | But it seems the COPY menu will also accompany, which I couldn't disable. Is there any possibilities to disable it? I tried around the forum and no solutions worked out. so itz okay to keep the COPY menu along with the other 2. which should now look like | Copy | MENU1 | MENU2 | But unfortunately, I 'm getting it displayed with a

Back Button on UIWebView

余生颓废 提交于 2019-12-05 02:17:10
I'm trying to figure out how to create a back button that allows the user to go back one page. I read through Apple's Docs (which still go way over my head) and found out that I need to setup the canGoBack and goBack 's. I have tried this, but for some reason it is not working. My UIWebView is named viewWeb , and I created and attached an outlet to my Back button, named backButton , and also tagged it as 1. Here is my code that I wrote in the View Controller: // Back button: -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { [

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

天大地大妈咪最大 提交于 2019-12-05 02:12:44
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 any app that uses a private API. Please help me out here! Thanks Everybody! What about keeping track

UIWebView content height not accurate in scrollview.contentsize

ⅰ亾dé卋堺 提交于 2019-12-05 02:11:06
I am trying to scroll to a particular page in a pdf document I have loaded in a UIWebView. I am able to do this without a problem in iOS 5 using: pageHeight = webView.scrollView.contentSize.height / numberOfPages; [[webView scrollView] setContentOffset:CGPointMake(0,pageNumber*pageHeight) animated:YES]; This only works however if the page has been loaded into the view already and the scroll to is triggered by a user action. For the case where I want to load a new pdf into the webview to a specific page, I am having trouble. I am requesting the load of the new pdf, and then doing something like

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

余生颓废 提交于 2019-12-05 02:01:11
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/ . 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-iphone-when-an-onclick-is

Xcode UIWebView local HTML

天大地大妈咪最大 提交于 2019-12-05 01:43:29
问题 I know HTML, javascript, CSS… but I wanted to make a native/hybrid iPhone app using HTML5 but without using something like PhoneGap or Nimblekit. I never wrote a real (not web app) iPhone app before, so i don't really know anything about Xcode. I already made a UIWebView with a tutorial that i found, but it displays a website (apple.com). How can i make this display a local file (index.html)? My code in ViewController.m under (void)viewDidLoad: [super viewDidLoad]; NSString *fullURL = @"html

how to handle javascript onorientationchange event inside uiwebview

一世执手 提交于 2019-12-05 01:40:45
问题 Anyone could help me how to handle orientation change event in javascript when visiting through uiwebview in iphone? I am trying to capture onorientationchange event of javascript. I tried following code. <style type="text/css" media="only screen and (max-device-width: 480px)"> .portrait { width: 300px; padding: 0 15px 0 5px; } .landscape { width: 460px; padding: 0 15px 0 5px; } </style> <script type="text/javascript"> window.onload = orientationchange; window.onorientationchange =

iOS: Resize UIWebView after didFinishLoad (content should fit without scrolling)

梦想的初衷 提交于 2019-12-05 01:31:55
问题 I am absolutely unable to resize my UIWebView . My UIWebView is declared in .h and in connected in IB. The height in IB is 110. But the height of my text is about 1500. Now I'd like to change the height so the full text is readable without scrolling. What code does resize my UIWebView in webViewDidFinishLoad ? Can't find ANYTHING that works. 回答1: The UIScrollView property is available for UIWebView starting in iOS 5. You can use that to resize your view by implementing the