Home > Enterprise >  React Native cannot change button colors
React Native cannot change button colors

Time:01-29

I am studying react native "bar" developing an app. I am not designing the fine details of the app. But I would like to change the button color at least I've tried this.

   <Button style={{    backgroundColor: 'black'}} onPress={() => regiao()} title="Entrar">       </Button> 

And several other things, but the hole button is always blue.

CodePudding user response:

Color is a separate variable in your component, do this:

   <Button color='black' onPress={() => regiao()} title="Entrar">       </Button> 

See: https://reactnative.dev/docs/button

CodePudding user response:

Do that: <Button color='black'></Button>

Without style.

  • Related