uiwebview

Prevent UIWebView for Repositioning for input field

让人想犯罪 __ 提交于 2019-11-30 15:27:03
I have an iPad application in which I am displaying an input form as a UIWebView in a UIPopoverController. My popover controller is sized such that it does not have to be resized when the keyboard appears. When I tap in an input field in the UIWebView, the web view is pushed further up when the keyboard appears. It is pushed up to the point that the text field is at the top of the frame. (This is the standard behavior you see when using forms in mobile safari). The webview does not scroll at all before the keyboard is up, but once it is, (as seen in the second image) I can scroll the webview

iOS custom font path for UIWebViews

Deadly 提交于 2019-11-30 15:26:42
I have a UIWebView and I have a custom font I want to load into an editable html document that I will be displaying through the UIWebView. In my SupportingFiles (resources) folder I have "Nosifer-Regular.ttf"... To use the custom font in my HTML I need the path (URL) to the font tile... I tried doing this, but it didn't seem to work... any ideas? bundle = [NSBundle mainBundle]; pathFont = [bundle bundlePath]; fontURL = [NSBundle pathForResource:@"Nosifer-Regular" ofType:@"ttf" inDirectory:pathFont]; path_font = [fontURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

Ignoring NSURLErrorDomain error -999 does not work in UIWebView

寵の児 提交于 2019-11-30 15:25:28
问题 I'm trying to avoid the problem generated while UIWebView 's delegate returns an error like that. I have the common workaround (I saw it anywhere in the Internet) in my delegate implementation - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { if ([error code] == NSURLErrorCancelled) return; } The problem I have is that this does not works always. Sometimes loads the web, another times loads parts of the web (the header, a part of the text...) and several times does

iPhone app: avoiding white screen after splash screen. Let splash screen linger, hide it after UIWebview loads? Splash screen not hiding properly

北慕城南 提交于 2019-11-30 15:23:46
Our goal is simple for an iPhone app: show a splash page then hide it when a UIWebview is ready to show its page. We need the default splash screen to linger until the UIWebview is ready to display. Otherwise, a white screen appears briefly. Unfortunately, the splash screen fails to hide after we make it linger. The default splash screen remains visible, concealing the UIWebview underneath. We understand this may violate Apple guidelines. This is more for a prototype than anything, and we would like to understand what we're doing wrong. Any clues? We're using Xcode 4.2. AppDelegate.m: // //

GeneralBlock-56 memory leak when calling loadRequest in UIWebView

徘徊边缘 提交于 2019-11-30 15:21:03
I'm working on an IPad app and have been profiling it using Instruments in XCode 4. I'm profiling on the actual device itself. iOS 4.3 is installed. Instruments tells me I have some memory leaks, the leaked objects being mainly GeneralBlock-56 ones and some GeneralBlock-1024 / GeneralBlock-8192 ones. The interesting thing is that these leaks are reported only when I load up a URL in a UIWebView embedded in my app. If I comment out the loadRequest call, these leaks go away. This behavior is consistently reproducible. The loadRequest() calls looks like this: [webPage loadRequest:[NSURLRequest

UIWebView and Animation

亡梦爱人 提交于 2019-11-30 15:20:03
I am wondering if there was a way to animate the size and position of a UIWebView. If I do sth like this: [UIView animateWithDuration:1.0 animations:^{ self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); }]; or [UIView beginAnimations:@"zoomIn" context:nil]; [UIView setAnimationDuration:2.75]; [UIView setAnimationDelegate: self]; self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); [UIView commitAnimations]; while there is a grey box doing the animation, the content of the WebView instantly switches to the new size without animating. (the scalesPageToFit property is set to YES) any suggestions on

Displaying a background image on UIWebView

守給你的承諾、 提交于 2019-11-30 14:40:11
I'm trying to build a native application that for all intents and purposes is HTML/CSS and Javascript. It all works fine, but when the UIWebView loads there's a delay while the DOM is populated, images retrieved etc. Is there anyway to display a background image on the UIWebView, or something behind it? Ideally this will be the same as the splash screen so it doesn't affect the experience of transitioning from slash to app. Thanks Robbie I don't believe you want to be setting the UIWebView as transparent and showing an image behind it. Instead you should have some sort of view (maybe with a

Stop word-wrap dividing words

随声附和 提交于 2019-11-30 14:39:15
问题 body { word-wrap: break-word;} I've been using that code (above) to fit the text in the body into it's container. However what I don't like about it, is that it breaks up words. Is there another way where it will not break up words and only line break after or before a word? EDIT: This is for use within a UIWebView . 回答1: use white-space: wrap; . If you have set width on the element on which you are setting this it should work. update - rendered data in Firefox 回答2: May be a bit late but you

Enable Cookies in UIWebView

 ̄綄美尐妖づ 提交于 2019-11-30 14:32:55
How can I enable cookies in my iPhone Application that uses a UIWebView Window, so that my login system will work? For sure start with [NSHTTPCookieStorage sharedHTTPCookieStorage].cookieAcceptPolicy = NSHTTPCookieAcceptPolicyAlways; But, as mentioned by @JoelFan, the issue may be your User Agent string causing ASP.NET to attempt and fail at a cookieless login. Instead of a response that includes Set-Cookie: .ASPXAUTH= really-long-hex-number it returns a redirection to something like Location: /(F( long-sorta-base64ish-looking-string ))/ The default UIWebView user agent string is something

Ignoring NSURLErrorDomain error -999 does not work in UIWebView

随声附和 提交于 2019-11-30 14:31:51
I'm trying to avoid the problem generated while UIWebView 's delegate returns an error like that. I have the common workaround (I saw it anywhere in the Internet) in my delegate implementation - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { if ([error code] == NSURLErrorCancelled) return; } The problem I have is that this does not works always. Sometimes loads the web, another times loads parts of the web (the header, a part of the text...) and several times does not load anything. Is there any other solution to this? Exists any open source implementation of a