I use IUWebView as a chat window, and after adding a new message at the bottom of the window I want to scroll down the program, how can I do this?
Inject this method into your UIWebView Delegate.
- (void)webViewDidFinishLoad:(UIWebView *)webView { [webView stringByEvaluatingJavaScriptFromString:@"window.scrollTo(document.body.scrollWidth, document.body.scrollHeight);"]; }
Have you tried something like this:
[mywebview stringByEvaluatingJavaScriptFromString:@"window.scrollTo(x, y);"]
, UIWebView , -
NSArray *views = [NSArray arrayWithArray:[self.webview subviews]]; self.scrollview = (UIScrollView *)[views objectAtIndex:0];
self.scrollview.delegate = self, , UIScrollView, google " UIScrollView", , . , .
self.scrollview.delegate = self
Source: https://habr.com/ru/post/1725945/More articles:application to stop help - formsКак получить опции (значение или текст) с помощью jQuery - jqueryReading and writing files inside asp.net web application - fileAsp.Net: passing value from page to UserControl - asp.netВне браузера Silverlight - как настроить автоматические обновления? - silverlightOpenCV with QT on Maemo 5 (N900) - c ++C # exclude full form / usercontrol using compiler constants - c #Best practice for easy deployment of multiple solutions - installerAccess Control Design Models - design-patternsVim and extended ASCII characters? - vimAll Articles