react-native - Card 组件中的背景颜色
问题描述
如何更改整张卡片的背景颜色?
在以下代码的情况下,颜色仅在 Item 元素下发生变化
整张牌一直是白色的
<Card style={{flex:1, backgroundColor:'blue'}}>
<CardItem header>
<Text>List of users</Text>
</CardItem>
<List
leftOpenValue={75}
rightOpenValue={-75}
dataSource={this.ds.cloneWithRows(this.state.data[0].users)}
disableLeftSwipe = {true}
renderRow={(item) => this._renderContent(item)}
/>
</Card>
解决方案
您已为每个 cardItem 明确设置背景颜色
<Card style={{flex:1, backgroundColor:'blue'}}>
<CardItem header style={{backgroundColor:'blue'}}>
<Text>List of users</Text>
</CardItem>
<List
style={{backgroundColor:'blue'}}
leftOpenValue={75}
rightOpenValue={-75}
dataSource={this.ds.cloneWithRows(this.state.data[0].users)}
disableLeftSwipe = {true}
renderRow={(item) => this._renderContent(item)}
/>
</Card>
推荐阅读
- c++ - 使用具有依赖关系的 qt-creator 编译 .pro 文件?
- javascript - 如何提取 html 中特定 json 的内容?
- rust - 有没有办法使用 rust-sdl2 在结构中存储纹理?
- reactjs - jq: 1 编译错误 jq: 错误: schedule/0 未定义在
,第 1 行: .Christchurch.bus-schedule.from["Weekday"] |= 。+ [“1646”] - jquery - 如何使jquery事件函数同步?
- node.js - Sinon stub mongoose save 来解析调用 save 的对象
- php - PHP Image Magick 将 SVG 转换为 PNG 后生成损坏的图像
- sql - 关于 WHERE CLAUSE SQL 的案例
- memory - 如何不安全地增加可变字节片的大小?
- python - 找不到命令“scrapy”