UITableView,UIWebViews和scrollsToTop属性=麻烦 [英] UITableView's, UIWebViews and the scrollsToTop Property = Trouble
问题描述
我的应用有一个 UITableView
。 UITableView有一个标题视图,它是一个 UIWebView
。
默认情况下,滚动视图的 scrollsToTop
属性设置为 YES
,这将使用户可以点击状态栏滚动到滚动视图的顶部。 / p>
当一个视图中嵌入了两个滚动视图时,它们的 scrollsToTop
属性设置为是
,点击状态栏什么都不做。
解决方案是设置之一的scrollsToTop
属性否
。这会重新启用状态栏。
现在问题是:UIWebView没有公开它的滚动视图,因此无法访问它的 scrollsToTop
属性。我只希望在点击状态栏时滚动到顶部的表格视图,而不是网页视图。
有谁知道如何实现这一目标?
现在有一个scrollView属性,首选:
myWebView.scrollView.scrollsToTop = YES;
My app has a UITableView
. That UITableView has a header view, which is a UIWebView
.
By default, scroll views have their scrollsToTop
property set to YES
, which will enable the user to tap the status bar to scroll to the top of the scroll view.
When there are two scroll views embedded in one view, that both have their scrollsToTop
property set to YES
, tapping the status bar does nothing.
The solution is to set one of the scrollsToTop
properties to NO
. That re-enables tapping the status bar.
Now here's the problem: UIWebView doesn't expose it's scroll view, and as a result, there is no access to it's scrollsToTop
property. I only want the table view to scroll to the top when the status bar is tapped, not the web view.
Does anyone know how I can achieve this?
There's now a scrollView property, which is preferred:
myWebView.scrollView.scrollsToTop = YES;
这篇关于UITableView,UIWebViews和scrollsToTop属性=麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!