skip to Main Content

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.

2

Answers


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

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

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

    To change the text color to red:

    <Button style={{color:'red'}} color='black' onPress={() => regiao()} title="Entrar">       </Button> 
    
    Login or Signup to reply.
  2. Do that:
    <Button color='black'></Button>

    Without style.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search