react-native-paper
react-native-paper copied to clipboard
Appbar content Left
Hey, i m trying to set content or title on the left and actions on the right side. But i m getting on ios title on center icons on left as suppose but i want to title to be on left corner.
So i put dummy back action and now works but this is workaround....
<Appbar.Header> <Appbar.Content title={ <Text variant="headlineSmall" style={globalStyle.weight600}> {title} </Text> } style={{alignItems: "flex-start"} /> <Appbar.Action icon={AddBox} onPress={() => { router.push(CreateEventNavigationConstant.What); }} /> <Appbar.Action icon={Bell} onPress={() => {}} /> </Appbar.Header>
i want actually this:
I digged into the code a bit to find out that on ios, it is assumed that you wish the title to be centered. (see here)
If you set <Appbar.Header mode="small">, it will actually make the title to the left on ios.
@lukewalczak is there any particular reasons for a different default value on ios? is this part of the MD guidelines? It feels quite counter-intuitive imo.