Scrolling a webview for nstask output

I’ve been playing with WebKit to provide css styled output from a shell script using nstask. I have hit a wall trying to make the webview keep it’s scroll position at the bottom like it would in a textview. Any thoughts on how I could achieve this? Right now, it jumps from top to bottom as it reloads from a notification.



Have you tried using scrollToEndOfDocument:?

Hi Shane!

Yeah, that’s what I’ve been using. I’m loading the webview from a read pipe function using loadHTMLString:baseURL. The page loads, scrolls to top, then scrolls to the bottom, really jumpy. I’d like to keep the scroll locked to the bottom if possible.

I’d appreciate any help you can provide.

Thanks again!

I suspect the only solution would be to load off-screen and swap it in, somehow. How, exactly, I don’t really know.

Thanks for your insight! I had thought about that, but didn’t know how to go about it. Would you load it into another view and swap them. or something else? :slight_smile:

^edit… Sorry, had a couple glasses of wine and it didn’t register that you already suggested swapping it in :slight_smile:

Thanks again!

As i said, I don’t really know. A WebView is an odd thing, because it seems to add its own scroll view and scrollers. You might be able to have two overlapping views, and toggle which one is hidden. Or even get the image as a tiff or PDF, and showing that in a view over the top while updating is happening.