mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-07 23:18:38 +08:00
fix: 下拉刷新 spinner 被顶部导航栏遮挡
改用 RefreshControl 并设置 progressViewOffset = insets.top + NAV_H, 将刷新指示器下移到导航栏以下,使其可见。
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState, useRef } from 'react';
|
import React, { useEffect, useState, useRef } from 'react';
|
||||||
import {
|
import {
|
||||||
View, StyleSheet,
|
View, StyleSheet,
|
||||||
Text, TouchableOpacity, ActivityIndicator, Animated, Image,
|
Text, TouchableOpacity, ActivityIndicator, Animated, Image, RefreshControl,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
@@ -54,8 +54,13 @@ export default function HomeScreen() {
|
|||||||
columnWrapperStyle={styles.row}
|
columnWrapperStyle={styles.row}
|
||||||
contentContainerStyle={{ paddingTop: insets.top + NAV_H + 8, paddingBottom: insets.bottom + 16 }}
|
contentContainerStyle={{ paddingTop: insets.top + NAV_H + 8, paddingBottom: insets.bottom + 16 }}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
onRefresh={refresh}
|
refreshControl={
|
||||||
refreshing={refreshing}
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={refresh}
|
||||||
|
progressViewOffset={insets.top + NAV_H}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onEndReached={() => load()}
|
onEndReached={() => load()}
|
||||||
onEndReachedThreshold={0.5}
|
onEndReachedThreshold={0.5}
|
||||||
ListFooterComponent={
|
ListFooterComponent={
|
||||||
|
|||||||
Reference in New Issue
Block a user