【问题标题】:React Native cannot change button colorsReact Native 无法更改按钮颜色
【发布时间】:2023-01-28 23:27:47
【问题描述】:

我正在研究 React Native“bar”开发应用程序。我没有设计应用程序的细节。但我想改变按钮颜色至少我试过这个。

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

还有其他一些东西,但孔按钮始终是蓝色的。

【问题讨论】:

    标签: react-native button colors


    【解决方案1】:

    颜色是您组件中的一个单独变量,请执行以下操作:

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

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

    【讨论】:

      猜你喜欢
      • 2021-05-23
      • 1970-01-01
      • 2023-02-08
      • 2020-02-26
      • 2019-07-06
      • 2015-11-27
      • 2017-06-29
      • 2022-01-22
      • 1970-01-01
      相关资源
      最近更新 更多