uiwebview

Status bar detects taps only when the UIWebView is scrolled down a bit

给你一囗甜甜゛ 提交于 2019-12-08 05:13:56
问题 I have a UIWebView as the root view of a UINavigationController . When a webpage finishes to load, I hide the navigation bar, and I'm looking for a way to show it back. Right now, I'm trying to do that when the user taps the status bar (this approach looks to me more complicated than what I want). In order to accomplish this, firstly I get the scrollView of the webView: for (id subview in mainWebView.subviews) { if ([[subview class] isSubclassOfClass: [UIScrollView class]]) { ((UIScrollView *

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

烂漫一生 提交于 2019-12-08 05:13:45
问题 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: 回答1: 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

iPhone app, alert users when they aren't connected to the internet?

自古美人都是妖i 提交于 2019-12-08 04:57:18
问题 What's an easy way to code an alert that warns users when they aren't connected to the Internet? I'm using Xcode, right now when there is no connection it is just a white screen in uiwebview. 回答1: Here you can check if wifi has connection, 3g,or none atall: if ([[Reachability reachabilityWithHostName:@"google.com"] currentReachabilityStatus] == ReachableViaWiFi) { // Do something that requires wifi } else if ([[Reachability reachabilityWithHostName:@"google.com"] currentReachabilityStatus] ==

iPhone Scroll images horizontally like in AppStore

依然范特西╮ 提交于 2019-12-08 04:52:45
问题 I was wondering if it's possible to create a HTML div container with some CSS magic that shows a horizontal scrollbar like the one with the screenshots on the iTunes preview on the web. I want this to work in Safari on the iPhone. e.g. http://itunes.apple.com/app/super-monkey-ball/id281966695?mt=8 I would like to use that to display thumbnails in an UIWebView on iPhone. I experimented with the overflow css property but didn't get it to work. Thanks for your replies. 回答1: I don't have time to

stringByEvaluatingJavaScriptFromString doesn't always seem to work

天涯浪子 提交于 2019-12-08 04:43:26
问题 I am developing an Objective C application that loads a large HTML document in to a UIWebView as the user scrolls through it. This is because the document is 20Mb and tends to crash the webview if loaded all at once. The idea is that the document is split in to chunks of HTML and as the user scrolls through it new elements are added to the document and old elements are removed. Currently I am working on getting the Objective C application to pass data to a javascript function within the

UIWebView and CSS fixed position

大城市里の小女人 提交于 2019-12-08 04:41:27
I have a UIWebView that uses a fixed position header. When the ViewController that contains the UIWebView is the initial view, there is no problem with the fixed position divs. When I display that same ViewController through a Modal segue, that's when the problem occurs. The first time I scroll on the page, the divs move and scroll with the page, but once I let go of scrolling for the first time, the div returns to its fixed position and the error never happens again. Any ideas? I've seen iScroll , it doesn't quite work like I want the page too, and I think there's an easier way, since I only

iPhone : load local html in uiwebview via javascript

半城伤御伤魂 提交于 2019-12-08 04:26:15
问题 it's a little bit confusing I know but let's try. i have uiwebview in my iphone app and it's loaded with html local file from the bundel .. I want to put html button in this file that can load another local file using javascript ... is that possible?? is there any other approach but that .. any help will be appreciated 回答1: You can do a custom protocol bridge between the web page and your app as the following : In you HTML page , you may add the following a tag for example : <a href=

Get clicked linked on uiwebview navigating on m.youtube.com on ios

有些话、适合烂在心里 提交于 2019-12-08 04:17:50
问题 I use uiwebview on my ios application. I have textbox above it and it navigates the uiwebview. I enter m.youtube.com and the webview perfectly loads it. I made a search on the youtube.com and the results is loaded perfectly. When I click any of the video I go to the video page, and I want to have that url link of the page will appear with video to watch. m.youtube.com/watch?v=sa+2DFdfd . . but how ? search notes: When I try this on my iphone 5 using safari I see the navigation bar changes

WKWebView gives SecurityError when bundling html and javascript with app

爱⌒轻易说出口 提交于 2019-12-08 04:03:00
问题 We are trying to migrate a hybrid app from UIWebView (iOS < 8) to WKWebView (iOS 8), but we are getting SecurityErrors when trying to store stuff using the DOM WebDatabase API (i.e. 'web sql databases'). The following throws an error if the index.html has been loaded from a bundled file with the app // throws SecurityError: DOM Exception 18 var db = openDatabase('mydb', '1.0', 'key value store', 1); The same code works fine with UIWebView. I can fallback to using Local Storage for some reason

How to force UIWebView to load before transition

随声附和 提交于 2019-12-08 03:42:03
问题 iOS 6.1 When a button is tapped, I want to perform a transition from an imageview to a webview. The problem is that the very first time the webview loads, the page is white and the html page loads after the transition: NepContainerView *containerInFrame = (NepContainerView *)[self view]; UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.frame]; [webView loadHTMLString:html baseURL:nil]; [UIView transitionWithView:containerInFrame duration:DURATION_TRANS_PHOTO_DESC options