Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 滚动到相应的 Model 以及相应的 offset #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions HybridPageKit/HybridPageKit/HybridPageKit/HPKPageHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)scrollToComponentView:(HPKView *)elementView atOffset:(CGFloat)offsetY animated:(BOOL)animated;

/**
* 滚动到对应的Model,以及Model相应的offset
*/
- (void)scrollToComponentModel:(HPKModel *)componentModel atOffset:(CGFloat)offsetY animated:(BOOL)animated;

/**
如果使用default webview,从pool中获取新webview,重置当前webview
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ - (void)scrollToComponentView:(HPKView *)elementView
[self.contentViewScrollHandler scrollToComponentView:elementView atOffset:offsetY animated:animated];
}

- (void)scrollToComponentModel:(HPKModel *)componentModel atOffset:(CGFloat)offsetY animated:(BOOL)animated {
[self.contentViewScrollHandler scrollToComponentModel:componentModel atOffset:offsetY animated:animated];
}

- (void)resetDefaultWebView {
HPKInfoLog(@"HPKPageHandler begin reset default webview");
[_contentViewScrollHandler removeComponentModelAndRelayout:_defaultWebViewControl.defaultWebViewModel];
Expand Down