In IOS, how to know whether the UIWebView's scroller is at the top? -



In IOS, how to know whether the UIWebView's scroller is at the top? -

i making ios application has action this.

http://www.flickr.com/photos/71607441@n07/6721920809/ total screen web view. when scroller on top, if touch webview, goes downwards , cover half of screen. (if scroller not on top, action won't do)

http://www.flickr.com/photos/71607441@n07/6721847313/ this.

i confused how know scroller position is.

uiwebview has few properties, , guess need embed uiwebview in uiscrollview, or have utilize javascript?

not sure you're trying exactly, if you're trying move uiwebview downwards whole i'd add together uiview , set uiview uiscrollview. maintain in fixed position relative other elements add together uiview. may wind odd behaviors though uiwebview contains uiscrollview , touch events have handled between 2 correctly.

if you're trying find out how far web view scrolled downwards "inside" itself, can utilize little hack:

nsstring *scrolltopstr = [webview stringbyevaluatingjavascriptfromstring:@"document.body.scrolltop;"]; nslog(@"scroll top: %@", scrolltopstr);

ios uiwebview uiscrollview uiscrollviewdelegate uiwebviewdelegate

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -