Skip to content

Commit

Permalink
fix(android): initialContentOffset takes effect too late
Browse files Browse the repository at this point in the history
  • Loading branch information
iPel authored and zoomchan-cxj committed Feb 17, 2023
1 parent 37a1b64 commit ca7f7e8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ public void setListData() {
mFocusHelper.setListData();
}

//notifyDataSetChanged 本身是可以触发requestLayout的,但是Hippy框架下 HippyRootView 已经把
//onLayout方法重载写成空方法,requestLayout不会回调孩子节点的onLayout,这里需要自己发起dispatchLayout
renderNodeCount = getAdapter().getRenderNodeCount();
dispatchLayout();
renderNodeCount = listAdapter.getRenderNodeCount();
if (renderNodeCount > 0) {
if (mInitialContentOffset > 0 && getChildCount() > 0) {
scrollToInitContentOffset();
}
}
//notifyDataSetChanged 本身是可以触发requestLayout的,但是Hippy框架下 HippyRootView 已经把
//onLayout方法重载写成空方法,requestLayout不会回调孩子节点的onLayout,这里需要自己发起dispatchLayout
dispatchLayout();
}

/**
Expand Down

0 comments on commit ca7f7e8

Please sign in to comment.