javascript - 如何在滚动时更改应用栏的背景颜色(REACT NATIVE)
问题描述
我想在滚动几次后将背景颜色设为白色......而且因为我的图标在滚动几次后也是白色的,所以我希望它是橙色或黑色......
我不太擅长解释,但我希望你能理解我想要达到的目标,我试图研究但一无所获......如果你能提供帮助,我将不胜感激......
<Appbar.Header style={styles.appbar}>
<Appbar.Action
style={{paddingLeft: 5}}
icon="wallet-outline"
color="white"
onPress={() => console.log('Pressed label')}
/>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
minWidth: 223,
marginHorizontal: 8,
backgroundColor: 'white',
borderRadius: 5,
}}>
<Appbar.Action
style={{paddingLeft: 5}}
icon="magnify"
size={18}
color="grey"
onPress={() => console.log('Pressed label')}
/>
<Text
style={{
fontSize: 16,
color: 'grey',
paddingRight: 5,
color: '#FB502F',
}}>
Find Your Services
</Text>
<Appbar.Action
icon="camera-outline"
size={20}
onPress={() => console.log('Pressed label')}
/>
</View>
<Appbar.Action
icon="cart-outline"
color="white"
onPress={() => console.log('Pressed label')}
/>
<Appbar.Action icon="message-text-outline" color="white" />
</Appbar.Header>
我在想一个 if 和 else 语句......但我只是新手反应原生所以我不知道如何......
同样,我想在滚动后将透明 AppBar 的背景颜色更改为白色,并且我希望图标也更改颜色,因为如果我的 AppBar 将是白色的,那么图标将不会被看到,因为图标是白色的。 ..
提前致谢!!!如果您需要更多信息/详细信息,您可以编辑我的帖子或评论我应该添加的内容,以便您更轻松地帮助我
解决方案
推荐阅读
- python - 抓取后将数据保存在csv中
- .net - 使用 HttpClient 上传大负载而无需缓冲
- docker - 增加 Windows 容器的交换文件大小
- oracle - 需要帮助在 oracle 中仅对包含特殊字符和数字的列中的数字求和
- oracle - 在 Apex 中选择交互式报告的列的数据
- nlp - 与 NLP 中的词干提取相关的查询
- meld - 融合不会自动在最前面打开
- node.js - 构建一个支持分面和分页的搜索 API
- node.js - 在 nuxt express 中间件中启用 cors
- eclipse-plugin - 在 Eclipse 中发布到 Tomcat 的问题