uiwebview

Objective-C: Play Youtube Video on App

那年仲夏 提交于 2019-12-03 07:38:18
问题 I am trying to explore what else can i do in iOS app development and it just now that i've tried to include a video on my app. I have this code below that aims to play a youtube video when the view loads, but all i got is just a black webView. NSString *videoURL = @"http://youtu.be/Wq_CtkKrt1o"; videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)]; videoView.backgroundColor = [UIColor clearColor]; videoView.opaque = NO; videoView.delegate = self; [self.view addSubview

How to rotate an UIWebView embedded video

孤街醉人 提交于 2019-12-03 07:32:55
问题 So I have this problem with an application I am building that I can't figure out. My application has the following structure: UITabBarController -> UIViewController -> UIViewController The last view controller contains an UIWebView which loads an entire page. In that page there is a movie (mp4) that users can play once they hit the big round play button. The application is made such that it runs in portrait mode, and there is no way I can do it run otherwise because of it's initial design.

iPhone dev: Increase scroll speed in UIWebView?

别等时光非礼了梦想. 提交于 2019-12-03 07:27:22
I have an app in which I render local HTML files in a UIWebView. The files, however, are sometimes large, and getting to where you want takes a long time with the default scroll speed. Is there any way to boost up the vertical scroll speed of a UIWebView? Bruno Delgado In iOS 5 we can access the scrollView property of the UIWebView . If you are targeting iOS 5+, you can simply call: webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal; Find a subview of UIWebView which is a UIScrollView, then set decelerationRate to UIScrollViewDecelerationRateNormal . This makes the

Tactics to speed up WKWebView rendering of loadHTMLString-d content?

会有一股神秘感。 提交于 2019-12-03 07:26:13
问题 I've been experimenting with stacking WKWebViews in a UINavigationController as a method of making a hybrid app that's more native than PhoneGap. It broadly works - I hook into decidePolicyForNavigationAction when a WKWebView hits a link, and push a new ViewController with the link it wants. But the page loading is slow. I've done everything I can think of to speed it up - it's using loadHTMLString rather than a request to ensure everything is local - I've even tried stripping out the CSS and

Can you intercept NSURLRequests in a UIWebView without breaking the back button?

烂漫一生 提交于 2019-12-03 07:22:36
问题 I'm having trouble loading custom HTML into my UIWebView without breaking its goBack method. What Works I'm intercepting the URL requests of my UIWebView so I can load custom HTML. I have control over all the HTML, so I have my special app requests use a custom scheme (ie. myapp://arg1/?arg2=val ) that I can parse in webView:shouldStartLoadWithRequest:navigationType: . I decide what HTML I really want to load and call loadHTMLString:baseURL and return NO to cancel the original request. What

Building an HTML5 iOS app with UIWebView

久未见 提交于 2019-12-03 07:20:20
问题 I have a client who suggested we simply wrap an HTML5 app as a native iOS app by just creating a UIWebView and offloading all of the application-logic to the HTML5 app. This would allow us to have a "native" iOS app and a good mobile app for other devices. However, this strikes me as a little odd and I was wondering what the pitfalls of such a plan would be. Does anyone have any experience doing this? Thanks, Trey 回答1: Any pitfalls you would experience as a web app you are likely to still

UIWebView scrolling down on input focus iOS 6 only

柔情痞子 提交于 2019-12-03 07:15:12
问题 I'm loading a UIWebView in a modal. The web page has some inputs that work exactly as intended in iOS 5. However in iOS 6, anytime an input gets focus, the keyboard is doing it's automatic 'centering' of the form even though the inputs have plenty of room to be shown above the keyboard. Since some of the inputs are at the top of the page, this forces them out of view so the user cannot see what they are typing. Scrolling back up to see the inputs causes the keyboard to stop working until

UIWebView - How to Disable Action Sheets (UIActionSheet)?

血红的双手。 提交于 2019-12-03 07:13:54
问题 I would like to know how you can disable UIActionSheets, specifically the Action Sheets being displayed after tapping and holding hyperlinks in a UIWebView. These seem to be enabled by default in UIWebViews containing the link address of the respective link in the title of the alert. They are also enabled in Safari. (How) is it possible to disable all Action Sheets of this kind within a UIWebView? Thanks in advance! 回答1: I just found this solution myself. Add this to your CSS: body { -webkit

UIWebView won't scroll till the end / bottom

╄→гoц情女王★ 提交于 2019-12-03 07:02:10
I have the same problem as described here: UIWebView doesn't scroll to the bottom of the webpage loaded/created (unfortunately nobody answered there) I have a UIWebView with inside UIView, and it doesn't scroll to the bottom, it's actually possible to scroll it but it is bouncing back again, so I can't see about bottom 100 px of my WebView, what can it be? Thank you Sorry guys, was my fault, I just had to reduce the height of the WebView I got this problem today. I had set the constraints wrt iPhone 4 inch screen. So when I executed the app on iPhone 3.5 inch screen, it didn't show the bottom

Getting rid of link-click “flash” indicator in iOs UIWebView

筅森魡賤 提交于 2019-12-03 06:59:34
问题 My iPad app uses a lot of UIWeb views to display content. The user clicks small images with links to pull up a smaller view with additional content. When you tap a link in a UIWebview, the link highlights gray for a moment to indicate the click. In the case of links in an in an image, the whole image rectangle flashes gray for a moment, and it's pretty ugly. Is there any way to disable this behavior? 回答1: Sure, use the -webkit-tap-highlight-color CSS property: <style type="text/css"> a {