没有真正的方法可以通过已发布的API来实现这一点,但是我认为在这种情况下,可以猜测
UIScrollView
子视图,只要您确保您的应用程序不会崩溃,如果您找不到
UISCLVIEW
:
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
}
编辑:
上面的内容不起作用,因为
UIWebView
是一个
UIScroller
不是
UISCLVIEW
(我的记忆可能在捉弄我)。也许可以尝试以下方法?
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
}