diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/hippylist/HippyRecyclerView.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/hippylist/HippyRecyclerView.java index fa65206c46d..412964b087c 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/hippylist/HippyRecyclerView.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/hippylist/HippyRecyclerView.java @@ -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