Get iPhone Status Bar Height

CGRect rect;
rect
= [[UIApplication sharedApplication] statusBarFrame];
NSLog(@"Statusbar frame: %1.0f, %1.0f, %1.0f, %1.0f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);

import React, { useState } from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, } from 'react-native'; import { Header, LearnMoreLinks, Colors, DebugInstructions, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; import { RefreshAnimateHeader, RefreshNormalHeader } from 'react-native-smart-refresh'; // 手动定义 SunColor const SunColor = '#FFD700'; const App = () => { const [refreshing, setRefreshing] = useState(false); const [isRefreshing, setIsRefreshing] = useState(false); const onRefresh = () => { // 模拟刷新逻辑 setRefreshing(true); setIsRefreshing(true); setTimeout(() => { setRefreshing(false); setIsRefreshing(false); }, 2000); }; return ( <> <StatusBar barStyle="dark-content" /> <SafeAreaView> <ScrollView refreshControl={ <RefreshAnimateHeader refreshing={refreshing} onRefresh={onRefresh} /> } > <Text>这是第一个 ScrollView 的测试内容</Text> </ScrollView> <ScrollView refreshControl={ <RefreshNormalHeader refreshing={isRefreshing} onRefresh={onRefresh} containerStyle={{ marginBottom: 20, alignItems: 'flex-end' }} titleStyle={{ fontSize: 14 }} timeStyle={{ fontSize: 14 }} leftContainerStyle={{ marginBottom: 8 }} activityIndicatorProps={{ color: SunColor }} /> } > <Text>这是第二个 ScrollView 的测试内容</Text> </ScrollView> </SafeAreaView> </> ); }; const styles = StyleSheet.create({ scrollView: { backgroundColor: Colors.lighter, }, engine: { position: 'absolute', right: 0, }, body: { backgroundColor: Colors.white, }, sectionContainer: { marginTop: 32, paddingHorizontal: 24, }, sectionTitle: { fontSize: 24, fontWeight: '600', color: Colors.black, }, sectionDescription: { marginTop: 8, fontSize: 18, fontWeight: '400', color: Colors.dark, }, highlight: { fontWeight: '700', }, footer: { color: Colors.dark, fontSize: 12, fontWeight: '600', padding: 4, paddingRight: 12, textAlign: 'right', }, }); export default App; 请修改这个代码来适配15promax版本
最新发布
10-01
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值