uiwebview

Improving UIWebView initialization time

独自空忆成欢 提交于 2019-12-07 17:52:01
问题 My company uses a UIWebView to display ads. The issue I'm having is that initializing a UIWebView appears to be expensive; profiling with Time Profiler shows [UIWebView alloc] initWithFrame:CGRectMake(0,0,500,500)] to take 31–40ms. This is enough to cause noticeable frame drops in games running at 60 FPS. Is there a way to workaround this slow initialization time? My current ideas are to create a UIWebView when the app launches (but before gameplay has started), and reuse that (potentially

Opening URL to facebook page wall does not work in UIWebView

强颜欢笑 提交于 2019-12-07 17:33:35
问题 I am trying to display my facebook page wall (a link of the form http://www.facebook.com/PAGE_NAME?sk=wall) by passing this as a request to UIWebView. The view opens with the generic page (http://www.facebook.com/PAGE_NAME) unless I login to facebook inside my app UIWebView. The same link works fine in Safari even if I am not logged in. How can I make the UIWebView show the wall page? 回答1: Facebook redirects Facebook pages differently on the mobile device over the computer web browser. You'll

Why UIWebView Eating so many Memory?

社会主义新天地 提交于 2019-12-07 16:50:02
问题 I'm using a UIWebView to load a pure Text HTML page for my iPad app. The size of the HTMP page is only 40KB. But when I use the instrument to monitor the memory use for loading the UIWebView, I found down it consumes like 20MB memory, if I scroll the web view, the memory is even getting higher. Finally I get a level 1 memory warning. Could anyone help me with this? How could I reduce the memory for this? (I need to use the HTML to show the text here). NSString *htmlPath = [[NSBundle

statusbar issue on UIWebView embedded YouTube video playback

你说的曾经没有我的故事 提交于 2019-12-07 16:26:52
问题 Playing youtube video as below: videoView = [[UIWebView alloc] initWithFrame:CGRectMake(10, 50, 300, 215)]; videoView.backgroundColor = [UIColor clearColor]; videoView.opaque = NO; videoView.delegate = self; [self.view addSubview:videoView]; NSURLRequest *loadRequest=[NSURLRequest requestWithURL:Your_Youtube_URL]; [videoView loadRequest:loadRequest]; Issue: Statusbar issue on UIWebView embedded YouTube video playback Steps to produce Status bar issue: When application orientation support is

About solution of offline mode for online HTML5 video system

£可爱£侵袭症+ 提交于 2019-12-07 15:48:50
问题 We have online website system with a lot of feature such as playback video etc. The purpose is that we want to make offline mode application for the iPad with UIWebView support. Two choices: Use HTML5 manifest to implement offline mode , here Download all content of HTML/JavaScripts/CSS and resources such as images/videos, then use UIWebView to load the HTML file For the solution 1, after searching we found a lot of problems such as cache limitation, not clear answer , 5MB ? 50 MB ? hard to

Stop the auto resize of the uiwebview web content when focus on input field

旧巷老猫 提交于 2019-12-07 15:28:52
问题 I have a UIWebView with a html form in it. The problem is that when I tap on the input field, the UIWebView automatically zoom in to the area close to the input field with the keyboard shows up. However, when the input is done and the keyboard is hidden, the html content remains zoom in. Is there a way to stop this behavior or programmatically resize the content back to the original view? (it is already registered with the keyboard hide event) Thanks. 回答1: Either set the font-size CSS

UIWebview load different files switch langage

不想你离开。 提交于 2019-12-07 15:17:35
I have differents embedded HTML files in different languages. I'd like to load the correct files in a webview based on the current langage. Is there a way to do that as easily as NSLocalizableString? thanks If you use "localized resources", for example english version of "index.html" in "en.lproj/index.html", french version of "index.html" in "fr.lproj/index.html", then many resource functions will automatically select the correct version (based on the user's language setting), e.g.: NSURL *url = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html"]; To create a localized

UIWebView Local Video / Audio playback in iOS not working, using Meteor (PhoneGap)

坚强是说给别人听的谎言 提交于 2019-12-07 14:14:14
问题 I'm using Meteor for building a really simple app (in theory). Basically a play button that should start a video. This sounds easy, but there seems to be something fundamentally wrong with how <video> and <audio> tags are handled in iOS UIWebView. It is my understanding that Meteor utilizes a local server so you can load asset files from the /public -folder in your Meteor application. This works as expected for images: <img src="/images/image.png"> However, doing the same with videos and

How do I catch UIWebView errors in MonoTouch?

女生的网名这么多〃 提交于 2019-12-07 13:16:26
Here's an answer for a similar question in Objective C but I'm not sure what's the right way to translate it to MonoTouch. Basically, I want to be able to catch JavaScript errors and know at least filename and line number—unfortunately, window.onerror doesn't give this crucial information. In particular, I'm not sure if I should expose a native library or if I can write this in pure MonoTouch. Dan Abramov I adopted Pablo's UIWebView+Debug category inspired by Robert Sanders and Kresimir Prcela's answers . Note that his code also includes a private API call you can use to enable remote web

What causes a parent container to cut off content in child element?

旧时模样 提交于 2019-12-07 11:31:25
On Mac Safari and Chrome, this dark select box appears correctly: In iOS Safari, it gets cut off at the border of the selected div: What could make that happen? Here are the styles of the selected parent: and on the select box: One of the parents of the select box had overflow-y hidden. 来源: https://stackoverflow.com/questions/29551733/what-causes-a-parent-container-to-cut-off-content-in-child-element