-
-
Notifications
You must be signed in to change notification settings - Fork 643
Expand file tree
/
Copy pathTest3438.tsx
More file actions
58 lines (53 loc) · 1.4 KB
/
Test3438.tsx
File metadata and controls
58 lines (53 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React from 'react';
import { View, Text, StyleSheet, I18nManager } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function HomeScreen() {
return (
<View style={styles.container}>
<Text>Issue #3438</Text>
<Text>headerTitleAlign: center + headerTitle as function</Text>
<Text>RTL mode: {I18nManager.isRTL ? 'YES' : 'NO'}</Text>
<Text style={styles.note}>
The header title above should say "Custom Title".
{'\n'}If it's missing or there's extra space, the bug is present.
</Text>
</View>
);
}
function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{
headerTitleAlign: 'center',
headerTitle: () => (
<Text style={{ fontSize: 18, fontWeight: 'bold' }}>
Custom Title
</Text>
),
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 20,
gap: 8,
},
note: {
textAlign: 'center',
marginTop: 20,
color: 'gray',
},
});
export default App;