Skip to content

Commit

Permalink
fix(android): initialContentOffset not working
Browse files Browse the repository at this point in the history
  • Loading branch information
iPel authored and zealotchen0 committed Jul 25, 2023
1 parent eebd7a1 commit 3e3b5a8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ public void setListData() {
LogUtils.d("HippyRecyclerView", "itemCount =" + listAdapter.getItemCount());
listAdapter.notifyDataSetChanged();
renderNodeCount = listAdapter.getRenderNodeCount();
if (renderNodeCount > 0) {
if (mInitialContentOffset > 0 && getChildCount() > 0) {
scrollToInitContentOffset();
}
if (renderNodeCount > 0 && mInitialContentOffset > 0) {
scrollToInitContentOffset();
}
//notifyDataSetChanged 本身是可以触发requestLayout的,但是Hippy框架下 HippyRootView 已经把
//onLayout方法重载写成空方法,requestLayout不会回调孩子节点的onLayout,这里需要自己发起dispatchLayout
Expand Down

0 comments on commit 3e3b5a8

Please sign in to comment.