From 9ceb3b0d9401e0c6cb30a4bc7af248c958637652 Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 10 Mar 2026 21:07:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=E9=A1=B5=E9=9D=A2=E6=8A=96=E5=8A=A8?= =?UTF-8?q?/=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=BC=B9=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ListFooterComponent 在 loading 结束时从 ActivityIndicator 变为 null, content 高度骤降触发虚假 scroll event,diffClamp 误判为上滑把导航栏顶出。 改为 footer 保持固定高度 48px,仅切换 spinner 的显隐,消除高度变化。 --- app/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/index.tsx b/app/index.tsx index c41bd13..566ddeb 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -58,7 +58,11 @@ export default function HomeScreen() { refreshing={refreshing} onEndReached={() => load()} onEndReachedThreshold={0.5} - ListFooterComponent={loading ? : null} + ListFooterComponent={ + + {loading && } + + } onScroll={Animated.event( [{ nativeEvent: { contentOffset: { y: scrollY } } }], { useNativeDriver: true } @@ -152,8 +156,8 @@ const styles = StyleSheet.create({ backgroundColor: '#00AEEC', borderRadius: 1, }, - row: { paddingHorizontal: 8 }, + row: { paddingHorizontal: 8, justifyContent:'center' }, leftCol: { marginLeft: 4, marginRight: 2 }, rightCol: { marginLeft: 2, marginRight: 4 }, - footer: { marginVertical: 16 }, + footer: { height: 48, alignItems: 'center', justifyContent: 'center' }, });