React native 反应本机多选更改选择文本颜色
我对react native是新手,我正在尝试将多选组件添加到我的应用程序中 我的代码如下:React native 反应本机多选更改选择文本颜色,react-native,React Native,我对react native是新手,我正在尝试将多选组件添加到我的应用程序中 我的代码如下: <SectionedMultiSelect items={this.state.days} uniqueKey="id" hideSearch={true} subKey="day" selectText=&quo
<SectionedMultiSelect
items={this.state.days}
uniqueKey="id"
hideSearch={true}
subKey="day"
selectText="Select Days"
selectToggle={{ color: '#f79334' }}
showDropDowns={true}
readOnlyHeadings={true}
onSelectedItemsChange={this.onSelectedItemsChangeHomeRepair}
selectedItems={this.state.selectedDaysHomeRepair}
showChips={false}
theme = {
{
Colors:{
selectToggleTextColor:'#053075',
text:'#053075'
}
}
}
/>
有人知道如何将颜色应用于“选择日期”文本吗。谢谢您可以使用
渲染器选择文本
道具,通过自定义样式传递您自己的文本组件
<SectionedMultiSelect
items={this.state.days}
uniqueKey="id"
hideSearch={true}
subKey="day"
renderSelectText={() => <Text style={{ color: 'red', fontSize: 24 }}>Select Days</Text>}
selectToggle={{ color: '#f79334' }}
showDropDowns={true}
readOnlyHeadings={true}
onSelectedItemsChange={this.onSelectedItemsChangeHomeRepair}
selectedItems={this.state.selectedDaysHomeRepair}
showChips={false}
theme = {
{
Colors: {
selectToggleTextColor:'#053075',
text:'#053075'
}
}
}
/>
Select Days}
selectToggle={{color:'#f79334'}}
showDropDowns={true}
readOnlyHeadings={true}
onSelectedItemsChange={this.onSelectedItemsChangeHomeRepair}
selectedItems={this.state.selectedDaysHomeRepair}
showChips={false}
主题={
{
颜色:{
选择ToggleTextColor:“#053075”,
正文:“#053075”
}
}
}
/>
看看如何在示例中使用此选项。您可以使用
renderSelectText
属性,并通过自定义样式传递自己的文本组件
<SectionedMultiSelect
items={this.state.days}
uniqueKey="id"
hideSearch={true}
subKey="day"
renderSelectText={() => <Text style={{ color: 'red', fontSize: 24 }}>Select Days</Text>}
selectToggle={{ color: '#f79334' }}
showDropDowns={true}
readOnlyHeadings={true}
onSelectedItemsChange={this.onSelectedItemsChangeHomeRepair}
selectedItems={this.state.selectedDaysHomeRepair}
showChips={false}
theme = {
{
Colors: {
selectToggleTextColor:'#053075',
text:'#053075'
}
}
}
/>
Select Days}
selectToggle={{color:'#f79334'}}
showDropDowns={true}
readOnlyHeadings={true}
onSelectedItemsChange={this.onSelectedItemsChangeHomeRepair}
selectedItems={this.state.selectedDaysHomeRepair}
showChips={false}
主题={
{
颜色:{
选择ToggleTextColor:“#053075”,
正文:“#053075”
}
}
}
/>
请看一下如何在示例中使用此选项。其工作原理是,我还想更改切换图标的颜色,是否有任何方法可以做到这一点?请帮助您指的是哪个切换?你能提供一个完整的工作示例吗?这个组件有它的内置切换图标,顺便说一句,谢谢你,我使用颜色对象作为道具按照他们的文档传递给组件。它的工作,我也想改变切换图标的颜色,有什么方法可以做到这一点吗?请帮助你指的是哪个切换?你能提供一个完整的工作示例吗?这个.component有它的内置切换图标,顺便说一下,谢谢你,我使用颜色对象传递作为道具,根据他们的文档传递给组件。