简体   繁体   中英

React Native cannot change button colors

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.

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

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

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

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

Without style.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM