uiwebview

Cannot change YouTube video quality at all (always starts with “medium”) with iOS's WebView

廉价感情. 提交于 2019-12-13 05:42:12
问题 I tried to put player.setPlaybackQuality('hd720'); in onReady and onStateChange but nothing of that works (iPad or iPhone always starts with medium quality and it can't be changed) Even setting small quality doesn't change anything, these functions just doesn't work with iOS's UIWebView/WKWebView I also tried to play with size of elements in html just for fun (set hardcoded size, like 1920x1080px) but it also didn't work: <head> <style> * { margin: 0; padding: 0; } html, body { width: 1920px;

How to show image in webview?

淺唱寂寞╮ 提交于 2019-12-13 05:26:45
问题 I am trying to show image in UIWebView.But I don't know why my image is not shown in UIWebVeiw. Here is my code. -(void)pInterest { UIImage *myImage; myImage=imgView.image; WebViewController *webViewController = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil]; webViewController.mypimage = myImage; [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentModalViewController:webViewController animated:YES]; } Now after passing image to

XIB will not create UIWebView and is always nil

梦想的初衷 提交于 2019-12-13 05:21:11
问题 I am at a loss. I have a UIViewController with a UIWebView in it. When I run the application the UIWebView is never instantiated. Everything else comes up fine. Has anyone seen this before? Rob 回答1: I found the problem. The UIWebView does not instantiated UNTIL it is displayed. I was trying to load the website before I pushed the view controller into the navigation controller. 来源: https://stackoverflow.com/questions/9095529/xib-will-not-create-uiwebview-and-is-always-nil

Gray box on UIWebView Screenshot

这一生的挚爱 提交于 2019-12-13 05:19:05
问题 I save a webview screenshot to a file using this method: UIGraphicsBeginImageContext(webview.bounds.size); [webview.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [imageData writeToFile:imagePath atomically:YES]; But sometimes it's have a gray area in it. How i remove that a gray area? 来源: https://stackoverflow.com/questions/6149289/gray-box-on-uiwebview-screenshot

Parse url so that only maps links open in external app from within UIWebView?

≡放荡痞女 提交于 2019-12-13 05:12:35
问题 I have web content inside a UIWebView in my app. My goal is to have all links open normally inside the app, but any links starting with "http://maps", get opened in safari, so they can in turn be opened in the external iphone maps app. If you have a solution for this problem stop reading now, below I'm going to propose my solution. Currently all links are opened inside the app, so http://maps links open to m.google.com inside the app. The solution I'm thinking of involves this code which uses

How to draw a non-rectangle UILabel with paragraph truncation at the end?

五迷三道 提交于 2019-12-13 04:46:28
问题 I need to show a body of text similar to the one shown below and limited to the red non-rectangular area. Rob's answer to this question pretty much answers my question as well, but I also need to truncate at tail of the paragraph when the text is too long. Extra question: is it also possible to set minimum font size similar to UILabel? 回答1: Try using NSString::sizeWithFont:constrainedToSize method which is documented here. You can specify the fontsize and maximum size for the text. You can

UIView inserted into UIWebView's scrollview, is not clickable in landscape mode

三世轮回 提交于 2019-12-13 04:42:55
问题 so basically, for reasons in this answer ive put a UIView inside a webview so that it acts as a header to the view. its works perfectly for ipad, but on iphone when the webview is rotated landscape, the header UIView isnt clickable. ive tried in the - (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation to explicitly set the userInteraction = true of the header view but this didnt work. i tried removing it from the superview and adding it back, but to no

Tap and hold save image from UIWebView

亡梦爱人 提交于 2019-12-13 04:35:42
问题 I want to be able to save an image to the photos app from a UIWebView when the user taps and holds on the image. I've managed to save an image from a UIWebView when I was programming in objective-c however now as I'm learning swift it seems to be kind of different. This is how I did it back in Objective-C: -(IBAction)saveWeb:(id)sender { UIGraphicsBeginImageContext(webview.frame.size); [self.webview.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage

Notification after Video playback in mobile safari

北战南征 提交于 2019-12-13 04:34:14
问题 I am trying to play some videos in a UIWebView and required to get some feedback when the video playback is finished, without any user interaction. I am looking for something similar to MPMoviePlayerPlaybackDidFinishNotification , but in UIWebView . Appreciate if anyone can share a work around. 回答1: I can't vouch for all video types but when I play a YouTube video in a UIWebView I can capture the event when the user presses 'Done' by subscribing to a private notification type: [

Confirm UIWebView link click

被刻印的时光 ゝ 提交于 2019-12-13 04:33:35
问题 I know that you can detect link clicks in a UIWebView with: UIWebViewNavigationTypeLinkClicked and easily access the url, i also know that you can: return YES or return NO if you want to advance to the next page or not...but is there a way to use a UIAlertView to determine if the use wants to return YES or NO? 回答1: This can be done. When you get the link in the webView:shouldStartLoadWithRequest:navigationType: delegate method, save off the URL, display the alert view, then return NO from the