简体   繁体   English

获取方向UIWebView滚动

[英]Get direction UIWebView is scrolling

Hey! 嘿! I need to find a way to keep my page's bounce scrolling looking good. 我需要找到一种方法来使页面的跳动滚动保持良好状态。 Here's what I need: 这是我需要的:

When the user scroll past a UIWebViews scrollable area (top), the background color of the view should be set to [UIColor colorWithRed:0.839 green:0.871 blue:0.871 alpha:1.000] and when the scrollable area is drug too far on the bottom, the color of the view should be set to [UIColor colorWithWhite:1.000 alpha:1.000] 当用户滚动经过UIWebViews的可滚动区域(顶部)时,视图的背景色应设置为[UIColor colorWithRed:0.839 green:0.871 blue:0.871 alpha:1.000]并且当可滚动区域的底部药物太远时,则视图的颜色应设置为[UIColor colorWithWhite:1.000 alpha:1.000]

Don't worry about the view being opaque and all that, becaue I've already done that in my code. 不必担心视图是不透明的,因为我已经在代码中做到了。

Maybe the following answer will help you or others with this problem: 也许以下答案可以帮助您或其他人解决此问题:

Detect when I scroll my UIWebView at top of the page 检测我何时滚动页面顶部的UIWebView

Seems to me your problem can be solved by retrieving the page offset and the page height, then set the background color accordingly when the top or bottom positions are surpassed. 在我看来,可以通过获取页​​面偏移量和页面高度来解决问题,然后在超过顶部或底部位置时相应地设置背景颜色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM