-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
webview 自定义滚动边界功能 #394
Comments
webview 的问题应该从内部 html 代码解决 |
解决了,让HTML告诉APP webview是否到顶,然后在下拉刷新。希望对大家有用。
|
@lizhw123 好样的!! |
参考: https://blog.csdn.net/ahuyangdong/article/details/77773323 private void _initSmartRefreshLayout() {
// TODO 抽出来
// https://github.com/scwang90/SmartRefreshLayout/blob/master/art/md_faq.md
//使上拉加载具有弹性效果
mSmartRefreshLayout.setEnableAutoLoadMore(false);
//禁止越界拖动(1.0.4以上版本)
mSmartRefreshLayout.setEnableOverScrollDrag(false);
//关闭越界回弹功能
mSmartRefreshLayout.setEnableOverScrollBounce(false);
// 这个功能是本刷新库的特色功能:在列表滚动到底部时自动加载更多。 如果不想要这个功能,是可以关闭的:
mSmartRefreshLayout.setEnableAutoLoadMore(false);
final MaterialHeader mMaterialHeader = (MaterialHeader) mSmartRefreshLayout.getRefreshHeader();
mMaterialHeader.setColorSchemeColors(new int[]{ViewPlus.getConfiguration(ConfigKeys.APP_THEME_COLOR)});
if (canPullRefresh()) {
mSmartRefreshLayout.setOnRefreshListener(refreshLayout -> mWebViewDelegate.refresh());
mSmartRefreshLayout.setScrollBoundaryDecider(new ScrollBoundaryDecider() {
@Override
public boolean canRefresh(View content) {
//webview滚动到顶部才可以下拉刷新
try {
return !(mWebViewDelegate.getWebViewOrNullllll().getScrollY() > 0);
} catch (Exception e) {
LoggerProxy.e(e, "canRefresh err");
}
return false;
}
@Override
public boolean canLoadMore(View content) {
return false;
}
});
}
} |
请问一下你这个canReload是什么值 |
@lizhw123 请问一下你这个canReload是什么值? |
// 配置滚动和防止刷新
|
嵌套了一个webview实现下拉刷新,页面比较长的时候,滑动一段距离后,在页面任意地方下拉都会触发下拉刷新。想使用smartLayout 提供的 自定义滚动边界功能,ScrollBoundaryDecider有demo吗?
The text was updated successfully, but these errors were encountered: