uiwebview

iOS webview leaves empty space before HTML content

只愿长相守 提交于 2019-12-06 06:29:30
I have the simplest view. A webview with some static HTML code embedded using the loadHTMLString message. The only thing I've modifed in the webview's properties from the storyboard is the "Scale page to fit" property (it's checked). However, as you can see in the image below, there's an empty space above the HTML that belongs to the webview (if I scroll the content it fills up that space). I've even tried just using... <html> <body><h1>Hello</h1></body> </html> ... but the space is still there (so I don't think it has anything to do with the HTML code). How can I remove that space? iOS

UiWebView response to window.print

僤鯓⒐⒋嵵緔 提交于 2019-12-06 06:14:19
问题 Is there a way to detect window.print from a UIWebView and respond to it? I have printing in my UiWebView and need to have a way to react to that event from the UIWebView. 回答1: First, this is the solution I came across. But UIWebview does not support those events and the API like in a desktop browser. And haven't yet got the matchMedia to work. Probably will work when I have a printer configured!?!. The actual reason is that the media type of the web page did not change from screen to print

Unable to load full Facebook comment plugins inside an iOS UIWebView

不想你离开。 提交于 2019-12-06 05:57:58
问题 I have a simple ViewController to load FB comments plugins inside a UIWebView @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; UIWebView * webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320.0f, 1505.0f)]; NSString * html = @"\ <!DOCTYPE html>\ <html xmlns:fb='http://ogp.me/ns/fb#'>\ <head>\ <meta name='viewport' content='width=device-width, initial-scale=1.0'>\ </head>\ <body style='background-color:red;'>\ \ <div id='fb-root'></div>\ <script>(function(d,

Console error “CGAffineTransformInvert: singular matrix” in UIWebView

*爱你&永不变心* 提交于 2019-12-06 05:48:41
问题 First and foremost, I have searched this thoroughly and I'm not convinced with any solution to start. I have a simple UIWebView wrapper and we have our code deployed on a static server. The URL of our server is the loading URL of the UIWebView, if there isn't any valid JSessionID, it redirects to the login page(from the client) which redirects back to our server when a successful JSessionID is captured. The console displays the following error Anshuks-MacBook-Pro-2.local xyz[40332] <Error>:

Disable UIWebView DiskImageCache

僤鯓⒐⒋嵵緔 提交于 2019-12-06 05:43:36
问题 When loading documents that contain images (such as a Microsoft Word docx file), the UIWebView will always cache the images when it receives a memory warning regardless of the cache policy. Following, there's a sample code snippet: NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:0 diskPath:[NSTemporaryDirectory() stringByAppendingPathComponent:@"URLCache"]]; [NSURLCache setSharedURLCache:sharedCache]; NSURLRequest* req = [NSURLRequest

showing a pdf in uiwebview on ios9 sometimes scrolling is stuck

折月煮酒 提交于 2019-12-06 05:30:21
问题 I'm working on an ios app written in swift, xcode7 A view has a UIWebView on it. using loadRequest(NSURLRequest) we load a pdf file from disk. This works fine, but sometimes the pdf file cannot be scrolled past the first page or what you see first on the screen. I can't pinpoint what causes the not-scrolling as sometimes I open the same file again and then it scrolls. Trying to scroll when it doesn't want to bounces the bottom part of the screen and you can see there is another page, but you

MonoTouch UIWebView and EvaluateJavascript

…衆ロ難τιáo~ 提交于 2019-12-06 05:23:26
I have an application working on the following envirnoment: Monotouch 2.1 MonoDevelop 2.4.2 MacOS 10.6.8 iOS SDK 4.3 The same application, migrated to iOS 5.0/5.1 and Monotouch 5.2.10 with MonoDevelop 2.8.8.4 under, has the following problem: When i click a button to navigate in a UIWebView do not work. Code is that:(obviously it's same in Monotouch 2.1) public void ScrollToTop (object sender, EventArgs evt) { webView.EvaluateJavascript("window.scrollTo(0,0)"); } What could i do? SOLVED (with Jonathan.Peppers help): public void ScrollToTop (object sender, EventArgs evt) { if((UIDevice

How can I get a UIWebView's UIScrollView delegate methods called from within a standard UIViewController?

风格不统一 提交于 2019-12-06 04:59:58
问题 So I just have a standard UIViewController with a UIWebView in it that displays a pdf. For the app functionality, I have need to be able to respond to the UIWebView's nested UIScrollView events like scrollViewWillBeginDragging, scrollViewDidScroll, etc. The only way I can get access to the scrollView is to (it seems like a hack) go in and get it by the subviews array: for (id subview in webView.subviews){ if ([[subview class] isSubclassOfClass: [UIScrollView class]]) { UIScrollView * s =

Textfield does not focus in UI WebView in iOS7

让人想犯罪 __ 提交于 2019-12-06 04:55:47
问题 The textfield does not focus if it is located in the bottom half of the screen but it works if it is in the top half. I find this problem in iOS7 in the simulator as well as the device in an installed app. Iam using sencha touch & phonegap but I dont think they are the reason for the problem since even a simple textfield positioned below half the height of the screen fails. When I tap on the textfield the OS should push the textfield a little above before the keyboard gets shown. But this

Cocos2d-x: possible to use HTML (UIWebView)?

我怕爱的太早我们不能终老 提交于 2019-12-06 04:38:05
问题 I'm trying out cocos2d-x and got to the point where I can build the Javascript samples for Android and run them inside a browser as well. Now I want to create my own game, but coming from a HTML background, I'd rather use HTML tags with CSS than use Javascript to setup the user interface. I've read about UIWebView which can display HTML-pages in an app, but I was wondering if anyone has ever done this in combination with Cocos2D-x ? And could this be transparent, to overlay a normal cocos2d-x