React native 如何在堆栈内垂直居中内容。将标题包括在计算中的屏幕?
如何在计算中垂直居中包含标题内容 当前,如果我尝试垂直居中屏幕上的元素,由于React native 如何在堆栈内垂直居中内容。将标题包括在计算中的屏幕?,react-native,react-navigation,React Native,React Navigation,如何在计算中垂直居中包含标题内容 当前,如果我尝试垂直居中屏幕上的元素,由于Stack.screen标题,它将稍微移动到屏幕底部。我希望在计算时不使用margintop:-N,其中N是页眉的大小 为什么没有利润?因为它增加了处理iOS和Android设备的额外复杂性 navigator.component.tsx <Stack.Navigator> <Stack.Screen name='SignIn' component={SignInComponent}
Stack.screen
标题,它将稍微移动到屏幕底部。我希望在计算时不使用margintop:-N
,其中N
是页眉的大小
为什么没有利润?因为它增加了处理iOS和Android设备的额外复杂性
navigator.component.tsx
<Stack.Navigator>
<Stack.Screen
name='SignIn'
component={SignInComponent}
/>
</Stack.Navigator>
const SignInComponent = () => {
return (
<View style={{ height: '100%', justifyContent: 'center' }}>
<Text>Example</Text>
</View>
)
}
sign-in.component.tsx
<Stack.Navigator>
<Stack.Screen
name='SignIn'
component={SignInComponent}
/>
</Stack.Navigator>
const SignInComponent = () => {
return (
<View style={{ height: '100%', justifyContent: 'center' }}>
<Text>Example</Text>
</View>
)
}
const SignInComponent=()=>{
返回(
实例
)
}
为什么没有利润?因为它增加了处理iOS和Android设备的额外复杂性
它增加了什么复杂性
从'@react导航/stack'导入{useHeaderHeight};
// ...
const headerHeight=使用headerHeight();
实例
为什么没有利润?因为它增加了处理iOS和Android设备的额外复杂性
它增加了什么复杂性
从'@react导航/stack'导入{useHeaderHeight};
// ...
const headerHeight=使用headerHeight();
实例