iOS:add onScrollEnd
This commit is contained in:
parent
15ce9cb6ba
commit
e7ac263921
@ -152,6 +152,30 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
|
||||||
|
if (self.onScrollEndFuncId) {
|
||||||
|
[self callJSResponse:self.onScrollEndFuncId,
|
||||||
|
@{
|
||||||
|
@"x": @(self.view.contentOffset.x),
|
||||||
|
@"y": @(self.view.contentOffset.y),
|
||||||
|
},
|
||||||
|
nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
|
||||||
|
if (!decelerate) {
|
||||||
|
if (self.onScrollEndFuncId) {
|
||||||
|
[self callJSResponse:self.onScrollEndFuncId,
|
||||||
|
@{
|
||||||
|
@"x": @(self.view.contentOffset.x),
|
||||||
|
@"y": @(self.view.contentOffset.y),
|
||||||
|
},
|
||||||
|
nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)scrollTo:(NSDictionary *)params {
|
- (void)scrollTo:(NSDictionary *)params {
|
||||||
BOOL animated = [params[@"animated"] boolValue];
|
BOOL animated = [params[@"animated"] boolValue];
|
||||||
NSDictionary *offsetDic = params[@"offset"];
|
NSDictionary *offsetDic = params[@"offset"];
|
||||||
|
Reference in New Issue
Block a user