uiwebview

UIWebView delegate vertical scroll event to parent, if scrolled to top or bottom

可紊 提交于 2019-12-03 16:41:02
I have an UIWebView in an UIScrollView, which is paginated. Basically I want to switch between different webviews with scroll / fling gestures. Horizontally it works fine. If the webview is scrolled to the "border of the page", the scroll/pan event is passed to the scrollview, so that the next page is shown. On the vertical axis, this does not work. There does not seem to be an event passed to the scrollview. It might be a problem with the bouncing, which I disabled, because I thought, it would consume the event. But even with bouncing disabled, this does not work. I tested this before with

How Do I Shorten the Pull Distance to Activate the Pull to Refresh Action in iOS 6/7?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 16:30:21
问题 Hey StackOverflow People, I've been trying to figure out this question for some time now but to no avail and I need some help. I have a UITableView close to the bottom of my app and there's not enough screen distance for the user to engage the refresh. Does anybody know how I can shorten the distance it takes to activate the pull to refresh action (via a UIRefreshControl in iOS 6/7) on a UITableView and UIWebView ? Thanks in advance everyone! 回答1: you can still use refreshControl but with

UIWebView rotation on iPad

天大地大妈咪最大 提交于 2019-12-03 16:29:16
问题 On the iPad, I present a view in the "detail" side of a split view controller that is basically just a UIWebView , which loads an HTML file in the application bundle. The application supports rotation and hides/shows the "master" side of the split as appropriate. When the UIWebView is initially loaded in landscape mode, its content seems to be "sized" properly... the content is taller than the screen, so you can scroll vertically, but not horizontally. (The HTML content is nearly all text

how to handle javascript onorientationchange event inside uiwebview

佐手、 提交于 2019-12-03 16:24:58
Anyone could help me how to handle orientation change event in javascript when visiting through uiwebview in iphone? I am trying to capture onorientationchange event of javascript. I tried following code. <style type="text/css" media="only screen and (max-device-width: 480px)"> .portrait { width: 300px; padding: 0 15px 0 5px; } .landscape { width: 460px; padding: 0 15px 0 5px; } </style> <script type="text/javascript"> window.onload = orientationchange; window.onorientationchange = orientationchange; function orientationchange() { if (window.orientation == 90 || window.orientation == -90) {

Loading string in UIWebview

耗尽温柔 提交于 2019-12-03 16:18:47
问题 How to load a string like below in UIWebview "\n \nEgestas rhoncus auctor ac. Risus parturient, mid ultrices nisi.\U00a0 \nAugue ac elementum duis aliquet dolor elementum cum?\U00a0 \nTristique, augue sit lorem adipiscing dis!\U00a0 \nNunc nunc ultricies pellentesque dis dictumst enim \n \n" I am trying to load this same content in 5 webviews..But it is crashing for me.. 回答1: You should use: [webView loadHTMLString:string baseURL:nil]; But note, that you won't preserve line breaks. To

iOS 7: UIWebView crashes because of range exception

帅比萌擦擦* 提交于 2019-12-03 16:06:46
I'm currently building an App that uses the krpano viewer, which is a Panorama Viewer built with JavaScript. I'm loading this Panorama viewer in a UIWebView with local images that are saved on the iPad. But after using the Panorama viewer for a while, I get this error and the app crashes: Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 4000} exceeds data length 0' *** First throw call stack: (0x2e213f53 0x38a226af 0x2e213e95 0x2eb4dc31 0x2e16ca65 0x2ef4ce47 0x2ef4cd21 0x2ef68f03 0x2ef682db 0x2ef68029 0x2ef67e61

Trying to load Facebook-Comments plugin in a UIWebView

左心房为你撑大大i 提交于 2019-12-03 15:59:08
I'm trying to view a facebook-comments plugin in a UIWebView on an iPhone application. I began with Facebook's iOS tutorial , where I implemented Single Sign-On. The app delegate takes care of Facebook's Single Sign-on, then redirects me to my single view controller, which displays a title bar and a UIWebView. I load the webview with a local file called "comments.html" which has been added and copied to my bundle/project directory. NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"comments" ofType:@"html"] isDirectory:NO]; NSURLRequest *request = [NSURLRequest

iOS: Resize UIWebView after didFinishLoad (content should fit without scrolling)

自作多情 提交于 2019-12-03 15:37:09
I am absolutely unable to resize my UIWebView . My UIWebView is declared in .h and in connected in IB. The height in IB is 110. But the height of my text is about 1500. Now I'd like to change the height so the full text is readable without scrolling. What code does resize my UIWebView in webViewDidFinishLoad ? Can't find ANYTHING that works. John Stephen The UIScrollView property is available for UIWebView starting in iOS 5. You can use that to resize your view by implementing the webViewDidFinishLoad: message in your delegate, like this: -(void)webViewDidFinishLoad:(UIWebView *)webView {

iOS 4.3 UIWebView -webkit-user-select:none; Problem

一个人想着一个人 提交于 2019-12-03 15:12:14
I've been developing an iPad application that uses UIWebView to display some text and image data which is working great. However, I'm trying to stop the user selection that occurs when the user hold the screen for a couple of seconds. The usual methods seem to work fine on everything other than iOS 4.3. I've tried a couple of different things such as: body, html { -webkit-user-select:none; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-touch-callout:none; } * { -webkit-user-select:none; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-touch-callout:none; } And: <body style='-webkit

UIWebView leaks, JS Garbage Collector & WebCore VMs

不羁的心 提交于 2019-12-03 15:03:28
问题 I've been building a browser feature for an app which obviously works with UIWebView. I've been seeing memory jump up when the browser opens which makes sense, however i'm seeing some troubling results during a leaks profile: The VM: JS garbage collector and VM: WebCore purgeable data just keep climbing the more I browse. Whats even worse is that when the browser is deallocated and it's web view released, these objects are still there, taking up upwards of 6 MB of memory. I'm not sure what if