-
-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the fontweight for the title to be customized (#706)
Added ability to change the fontWeight of the header title on iOS.
- Loading branch information
Showing
11 changed files
with
113 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react'; | ||
import {Button, Text, ScrollView, View} from 'react-native'; | ||
import {NavigationContainer} from '@react-navigation/native'; | ||
import {createNativeStackNavigator} from 'react-native-screens/native-stack'; | ||
|
||
function HomeScreen({navigation}) { | ||
return ( | ||
<ScrollView> | ||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> | ||
<Text style={{fontSize: 24}}>Home screen with a 'bold' title</Text> | ||
<Button | ||
onPress={() => navigation.navigate('Details')} | ||
title="Go to Details" | ||
/> | ||
</View> | ||
</ScrollView> | ||
); | ||
} | ||
|
||
function DetailsScreen() { | ||
return ( | ||
<ScrollView> | ||
<View> | ||
<Text>Details screen with a 'light' title</Text> | ||
</View> | ||
</ScrollView> | ||
); | ||
} | ||
|
||
const RootStack = createNativeStackNavigator(); | ||
|
||
function RootStackScreen() { | ||
return ( | ||
<RootStack.Navigator | ||
screenOptions={{ | ||
headerTitleStyle: {fontWeight: '900'}, | ||
headerLargeTitle: true, | ||
headerLargeTitleStyle: { | ||
fontWeight: '900', | ||
}, | ||
}}> | ||
<RootStack.Screen name="Home" component={HomeScreen} /> | ||
<RootStack.Screen | ||
name="Details" | ||
component={DetailsScreen} | ||
options={{ | ||
headerTitleStyle: {fontWeight: '100'}, | ||
headerLargeTitleStyle: { | ||
fontWeight: '100', | ||
}, | ||
}} | ||
/> | ||
</RootStack.Navigator> | ||
); | ||
} | ||
|
||
export default function App() { | ||
return ( | ||
<NavigationContainer> | ||
<RootStackScreen /> | ||
</NavigationContainer> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters