uiwebview

CSS3 Columns and UIWebView

放肆的年华 提交于 2019-12-05 07:27:37
问题 Using CSS3 columns to take a somewhat large text document and make it scroll horizontally. I want each column to be close to the size of the iPad screen, as I am displaying the content in a UIWebView. If I make the -webkit-column-width: property a relatively small number, everything works great. The text stops at the max-height set for the containing and columns out horizontally. If I make -webkit-column-width anything larger than about 300px, though, this css seems to get completely ignored.

UIWebView doesn't load images from protocol-relative URL

我的未来我决定 提交于 2019-12-05 07:15:57
Make an app with UIWebView which open a webpage with protocol-relative styles & images, such as <img src="//example.com/image.png"> (examples for http or https ). Override the page loading process via your custom NSURLConnection , this way . Result: it won't display the images! Though, Safari and other browsers show them correctly... I inspected the page opened in WebView and saw weird requests there. They looked like regular URLs, but with applewebdata scheme, e.g. applewebdata://art-u1.infcdn.net/articles_uploads/2/2586/thumb/3Dtouch%20Main-665x.png . Yay! It doesn't know the "base" scheme

UIWebView execCommand Cut, Copy, Paste

試著忘記壹切 提交于 2019-12-05 06:54:55
问题 I can't seem to get the execCommand for cut, copy, paste to work in a UIWebView that has contentEditable set to true. I am able to select the text using selectAll command but cut, copy, and paste do not work. This is the code I'm using: [webView stringByEvaluatingJavaScriptFromString:@"document.execCommand('cut', false, null)"]; Is there something else I need to do to allow clipboard operations to work? 回答1: As per previous comments cut, copy, paste commands don't appear to work so I managed

UIWebView Text Highlighting solution

自古美人都是妖i 提交于 2019-12-05 06:48:34
问题 Has anyone found a solution for highlighting user-selected blocks of text in a UIWebView? I have a partial solution in place, however I have been unable to get it to work when the selection includes multiple elements in the DOM. In that case, I can find and highlight the first element in the selection, but javascript seems unable to tell me where the end of the selection is in this case. It may be that I just don't understand the selection objects completely. It's difficult to find good

Is it possible to use stringByEvaluatingJavaScriptFromString with Javascript which references local files?

爱⌒轻易说出口 提交于 2019-12-05 06:47:53
问题 I want to use stringByEvaluatingJavaScriptFromString to run a javascript which references local files (in this case css files, but potentially js files too) which are on the device (in the Documents folder I guess?)... NSString *theJS = [[NSString alloc] initWithString:@"javascript:(function() {the_css.rel='stylesheet'; the_css.href='the_css.css'; the_css.type='text/css'; the_css.media='screen';} )();"]; [webView stringByEvaluatingJavaScriptFromString:theJS]; How would I get this to work? It

Progressbar WebView in Swift

為{幸葍}努か 提交于 2019-12-05 06:35:36
问题 I'm writing a webapp in swift with xcode. I've a question "How can I add a progressbar that shows me the loading of each page?" @IBOutlet var webView: UIWebView! override func viewDidLoad() { super.viewDidLoad() let url = NSURL(string: "http://stackoverflow.com") let request = NSURLRequest(URL: url) webView.loadRequest(request) } (Sorry for my english) 回答1: You can find a very good answer in this post. You can just add a progress bar as a subview to your webview. The main problem is the

UIWebView and timeouts

不羁的心 提交于 2019-12-05 06:22:35
I'm using a UIWebView to display some content. Within this content the user can navigate through a bunch of sites which are being loaded using AJAX. One step on this sites requires quite some time. Since I didn't find anything about a timeoue for UIWebView I tried to set it on the initial NSURLRequest it loads. Unfortunately this does not seem to do anything. I'm not quite sure if I'm supposed to set the timeout myself? Is there anything I'm missing? Does the UIWebView override my timeout? I'm a little bit confused on this so any help would be appreciated. :) Best –f Update I built a test

How to set background color for UIWebView in iPhone sdk

纵饮孤独 提交于 2019-12-05 05:59:14
I have added the back ground color as an image to uiwebview but it is coming to the back side of web view not to the web view. The web view is always in white colored view, I can't change it. myView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; myView.autoresizingMask=YES; webView = [[UIWebView alloc] init]; webView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"BG_Doctor.png"]]; webView.delegate = self; [myView addSubview:webView]; self.view=myView; Please help me to set the background color to webview not to back of it [webView setOpaque:NO]

User interaction sometimes screws up jQuery ajax requests in UIWebView

痞子三分冷 提交于 2019-12-05 05:42:24
I'm building an iPhone app that displays a UIWebView pointing to a web application I've created. The web application makes frequent web service calls for data items which are used to animate controls on a canvas. The calls for data use jQuery ajax, passing parameters via JSON and receiving an XML response. I'm finding that while user interactions with the UIWebView are occurring, the javascript setTimeout method is blocked and doesn't seem to execute at all. Fair enough; there are ways around this. But the major problem is that every now and then after user interactions (zooming, panning etc),

UIWebview resize height to fit content

烈酒焚心 提交于 2019-12-05 04:59:10
I know this has been asked many times but I can not get it to work. In short my UIWebview pulls in some HTML which has a none fixed height (width always the same), I just want the height to change accordingly. I have tried a number of fixes I have found online but my problem is the webview will change to the correct size but only for a brief second and then in flicks back to the original size. I should point out that my this view is invoked by a segue, that is the only thing I can think is different! I am wondering if the code works but when the segue finishes it's crossfade, flip or whatever