callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.71k stars 2.07k forks source link

Appbar content Left #4337

Open marijang opened 6 months ago

marijang commented 6 months ago

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.Content title={

{title}
    }
    style={{alignItems: "flex-start"}
  />
  <Appbar.Action
    icon={AddBox}
    onPress={() => {
      router.push(CreateEventNavigationConstant.What);
    }}
  />
  <Appbar.Action icon={Bell} onPress={() => {}} />
</Appbar.Header>`

i want actually this: ![Uploading Screenshot 2024-03-11 at 11.18.51.png…]()

ycmjason commented 2 months ago

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.