feat:Scroller add scrollTo method
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#import "DoricScrollerNode.h"
|
||||
#import "DoricExtensions.h"
|
||||
#import "DoricRefreshableNode.h"
|
||||
#import "DoricPromise.h"
|
||||
|
||||
@implementation DoricScrollView
|
||||
|
||||
@@ -132,4 +133,11 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
self.didScrollListener(scrollView);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)scrollTo:(NSDictionary *)params {
|
||||
BOOL animated = [params[@"animated"] boolValue];
|
||||
NSDictionary *offsetDic = params[@"offset"];
|
||||
CGPoint offset = CGPointMake([offsetDic[@"x"] floatValue], [offsetDic[@"y"] floatValue]);
|
||||
[self.view setContentOffset:offset animated:animated];
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user