fix: 下拉刷新 spinner 被顶部导航栏遮挡

改用 RefreshControl 并设置 progressViewOffset = insets.top + NAV_H,
将刷新指示器下移到导航栏以下,使其可见。
This commit is contained in:
Developer
2026-03-10 21:10:01 +08:00
parent 9ceb3b0d94
commit 621fbebc08

View File

@@ -1,7 +1,7 @@
import React, { useEffect, useState, useRef } from 'react';
import {
View, StyleSheet,
Text, TouchableOpacity, ActivityIndicator, Animated, Image,
Text, TouchableOpacity, ActivityIndicator, Animated, Image, RefreshControl,
} from 'react-native';
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
import { useRouter } from 'expo-router';
@@ -54,8 +54,13 @@ export default function HomeScreen() {
columnWrapperStyle={styles.row}
contentContainerStyle={{ paddingTop: insets.top + NAV_H + 8, paddingBottom: insets.bottom + 16 }}
renderItem={renderItem}
onRefresh={refresh}
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={refresh}
progressViewOffset={insets.top + NAV_H}
/>
}
onEndReached={() => load()}
onEndReachedThreshold={0.5}
ListFooterComponent={