Как обернуть собственные вкладки пользовательским заголовком?IOS

Программируем под IOS
Anonymous
Как обернуть собственные вкладки пользовательским заголовком?

Сообщение Anonymous »

Я использую Expo SDK 54.
В iOS, когда я использую expo-router/unstable-native-tabes, мы не можем обернуть другим компонентом.
AppHeader должен оказаться наверху страницы. В iOS 26 это не работает.
Как мы можем поместить это вверху каждой страницы?
import { useEffect } from 'react'
import { Platform } from 'react-native'
import { useAuth } from '@/context/AuthContext'
import { useRouter, Stack, usePathname } from 'expo-router'
import { NativeTabs, Icon, Label, Badge } from 'expo-router/unstable-native-tabs'
import MaterialIcons from '@expo/vector-icons/MaterialIcons'
import DashboardLayout from '@/components/layouts/DashboardLayout'
import AppHeader from '@/components/ui/header'

export default function ProtectedLayout() {
const pathname = usePathname()
const router = useRouter()
const { isAuthenticated, isLoading } = useAuth()

const isPublicStaticPage = pathname === '/privacy' || pathname === '/terms'
const isAndroid = Platform.OS === 'android'
const isIOS = Platform.OS === 'ios'

useEffect(() => {
if (!isLoading && !isAuthenticated && !isPublicStaticPage) {
router.replace('/details')
}
}, [router, isAuthenticated, isLoading, isPublicStaticPage])

if ((!isAuthenticated && !isPublicStaticPage) || isLoading) {
return null
}

if (isPublicStaticPage && !isAuthenticated) {
return
}

if (isAndroid) {
return (



)
}

if (isIOS) {
return (


Attendance




Timetable




Present




Att Code




Marks




CGPA




Subjects




Feedback

3



Profile




About




Privacy Policy




Terms and Conditions



)
}
return null;
}


Подробнее здесь: https://stackoverflow.com/questions/798 ... tom-header

Вернуться в «IOS»