uiwebview

Pre-populate HTML5 offline appcache for a UIWebView in an iOS application

泄露秘密 提交于 2019-12-10 01:04:36
问题 Is it possible to create a UIWebView that has an HTML5 offline appcache pre-populated so that it will work offline even if it is the first time the user is accessing the UIWebView? If so, how? I know I can achieve this through other mechanisms, but the above is my first choice. And I'm just plain curious if it's possible. I'm seeing nothing about it in the documentation. 回答1: I think this may reduce to a question of whether you can programmatically write to the UIWebView's cache file (which

UIWebView does not load HTTPS Page: Error Domain=NSURLErrorDomain Code=-999 “The operation couldn’t be completed. (NSURLErrorDomain error -999.)”

妖精的绣舞 提交于 2019-12-10 00:55:24
问题 Note: This question is still unanswered! I use a UIWebView to load the following URLs: https://buchung.salonmeister.de/ort/301655/menue/#offerId=907601&venueId=301655 https://buchung.salonmeister.de/place/#offer-details-page?id=907599&venueId=301655 http://feratel.lueneburger-heide.de/lhg/de/accommodation/detail/LUH/8634e147-e13d-40f5-8954-2ac40cfea2a7/romantik_hotel_bergström?customHeader=true http://feratel.lueneburger-heide.de/lhg/de/accommodation/detail/LUH/8af6d1fd-af6d-4765-8025

iOS button to webpage with uiwebview

回眸只為那壹抹淺笑 提交于 2019-12-09 21:59:31
问题 For a current project I am embedding a mobile site into an iOS app. I've taken use of the goback() and goforward() functions, with UIWebView. But how would I make a custom function that onClick (or onTouch which ever is the correct term) Sends the UIWebView back to the page initially loaded? Any Help would be much appreciated as I have bene unable to find anything on the web thus far. 回答1: Add something like to the implementation file: - (IBAction)loadPage:(id)sender; { NSURL *url = [NSURL

how can i set landscape orientation when playing a video from webview

主宰稳场 提交于 2019-12-09 19:08:10
问题 i have a webview with a video link, the app is only portrait orientation but i need to change orientation when the video is in fullscreen and use all screen. Thanks for your help. 回答1: Put this in your AppDelegate : - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { id presentedViewController = [window.rootViewController presentedViewController]; NSString *className = presentedViewController ? NSStringFromClass(

Get word under tap from UIWebView using JavaScript

夙愿已清 提交于 2019-12-09 18:58:48
问题 I'm displaying some local web content and would like to get the word under the tap point. The single tap delegate is setup and I can get it to work great if I use a UITextView and load the HTML with a NSAttributedString and NSHTMLTextDocumentType, but I lose formatting such as paragraph spacing and small caps; adding a NSMutableParagraphStyle is without effect. Using a UIWebView and loadHTMLString that includes JQuery, is there a way? There are several pages which show how to use JS to get

Swipe gesture for back/forward in UIWebView?

孤者浪人 提交于 2019-12-09 17:56:09
问题 I have a WebView in my app. Because it is a tabbed application I'm not able to add buttons for going back/forward on the website. I want to go back/forward by swiping. Right swipe from the left side/edge is back… like in Safari browser for iOS. How can I do it? I think i should use "Screen Edge Pan Gesture Recognizer", right? 回答1: Why not just use a swipe gesture recognizer? UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector

iPhone UIWebView loadHtmlString not added to history

白昼怎懂夜的黑 提交于 2019-12-09 16:12:17
问题 My UIWebview loads a local html file using loadHtmlString. The loaded page has links to other local html files as well as real links that use the internet. I have added a back button with: if ([self.webView canGoBack]) [self.webView goBack]; This works fine except it does not recognise the original page loaded with loadHtmlString. For example, if I navigate: local -> local -> web local X local <- web (The first back works, the next does nothing.) How can I get the webview to recognise the

UIWebView - white background before loading content

与世无争的帅哥 提交于 2019-12-09 16:09:31
问题 I have a question. I have a menu, when I click on it, it will load content remotely from URL via UIWebView. When I try on simulator, before loading the content, there's a white background and then loads my HTML Page (which has dark background) Demo: You can see that white flash, when I click on "KALENDER" How can I fix this issue? My UIWebView looks like this: let myWebView:UIWebView = UIWebView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))

Where can I learn more about WebCoreSharedBufferData?

ⅰ亾dé卋堺 提交于 2019-12-09 14:42:18
问题 I've got an app that was working perfectly on iOS 6, but on iOS 7, if there is a very specific action taken by the user (too complex to get into but it uses a UIWebView and it's consistent), the app crashes with the error: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 8} exceeds data length 0' Now I'm more than happy to do some research and experimentation myself, but I just can't find

UIWebView in UITableViewCell getting refreshed while scrolling

核能气质少年 提交于 2019-12-09 14:12:52
问题 I've a custom UITableViewCell with UIWebview to display the hyperlink text in user's activity (ref. attached image).UIWebView generally takes a sec to load HTML data. Also during scrolling, UIWebView will get refreshed again and it take a sec more, which looks very odd. I tried FancyLabel, but not able to achieve the same result. Any help would be appreciated. 回答1: Try NSAttributedString for this problem. Follow the mentioned links : http://developer.apple.com/library/mac/#qa/qa1487/_index