Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嘿!我需要找到一种方法来保持我的页面的反弹滚动看起来不错。这是我需要的:
当用户滚动经过 UIWebViews 可滚动区域(顶部)时,应将视图的背景颜色设置为[UIColor colorWithRed:0.839 green:0.871 blue:0.871 alpha:1.000],当可滚动区域在底部太远时,应将视图的颜色设置为[UIColor colorWithWhite:1.000 alpha:1.000]
[UIColor colorWithRed:0.839 green:0.871 blue:0.871 alpha:1.000]
[UIColor colorWithWhite:1.000 alpha:1.000]
不要担心视图不透明等等,因为我已经在我的代码中做到了。
也许以下答案会帮助您或其他人解决此问题:
检测我何时在页面顶部滚动 UIWebView
在我看来,您的问题可以通过检索页面偏移量和页面高度来解决,然后在超过顶部或底部位置时相应地设置背景颜色。