css - 在 react-native 中覆盖按钮背景颜色
问题描述
我是 react-native 的新手,我想知道是否有一种简单的方法可以覆盖按钮中的 backgroundColor。我确实尝试了很多方法,但没有运气。基本上我试图用我的自定义颜色默认替换蓝色背景。
有什么好的建议吗?
解决方案
请浏览Button in react native 的文档,
您可以轻松地为 Button 的 color 属性提供所需的颜色,如下所示:
<Button
title="Press me"
color="black" // Color of your choice
onPress={() => Alert.alert('Button with adjusted color pressed')}>
推荐阅读
- windows - imagemagick 批处理命令后的错误级别 0
- google-apps-script - 如何在 Google 表格中创建 Marimekko 图表?
- c - 为什么 C 输出中的自引用结构为空
- android - 使用 Android 8.0 的华为特有的 Android 原生崩溃 (tgKill)
- angular - Angular 根据当前模块改变页眉和页脚
- flutter - 使用 Android 警报管理器和隔离器 Flutter 后台进程
- python - 如何从调用 python 脚本的 bash 脚本转到调用 bash 脚本的 python 脚本?
- python - 如何在 python 中模拟 MATLAB 的 lsqlin
- java - 如何发送输入而不让用户在 Android Studio 中看到它
- python - 为什么即使有对类型的引用,第二个片段的输出也不是 40?