No hay una forma real de hacerlo mediante una API publicada; sin embargo, creo que en este caso está bien adivinar la subvista UIScrollView
, siempre y cuando se asegure de que la aplicación no se cuelgue si no puede encontrar el UIScrollView
:
UIView* scrollView = [webView.subviews objectAtIndex:0];
if ([scrollView isKindOfClass:[UIScrollView class]) {
[((UIScrollView*)scrollView) flashScrollIndicators];
} else {
// If Apple changes the view hierarchy you won't get
// a flash, but that doesn't matter too much
}
EDIT: lo anterior no funcionará porque la primera vista secundaria de un UIWebView
es un UIScroller
, no un UIScrollView
(mi memoria podría estar jugando trucos en mí). Tal vez intente lo siguiente?
UIView* uiScroller = [webView.subviews objectAtIndex:0];
if ([uiScroller respondsToSelector:@selector(displayScrollerIndicators)]) {
[((UIScrollView*)uiScroller) performSelector:@selector(displayScrollerIndicators)];
} else {
// If Apple changes the view hierarchy you won't get
// a flash, but that doesn't matter too much
}
Esta debería ser la respuesta aceptada – toddg