React native隐藏SectionedMultiSelect的选定项目列表

问题描述 投票:0回答:1

我想在React Native中隐藏SectionedMultiSelect的选定项目列表,以及如何将样式应用于此组件,我该怎么做???谁能帮我做到这一点。谢谢。

  <SectionedMultiSelect
            items={days}
            uniqueKey="id"
            hideSearch={true}
            subKey="day"
            selectText="Select Days..."
            showDropDowns={true}
            readOnlyHeadings={true}
            onSelectedItemsChange={this.onSelectedItemsChange}
            selectedItems={this.state.selectedItems}
            // styles={}
           />

i want to hide that highlighted portion of image.

react-native
1个回答
0
投票

我假设您使用https://github.com/renrizzolo/react-native-sectioned-multi-select程序包,并且selectedItems状态为具有选定选项的数组


 <SectionedMultiSelect
        items={days.filter(day => this.state.selectedItems.indexOf(day) == -1)}
        uniqueKey="id"
        hideSearch={true}
        subKey="day"
        selectText="Select Days..."
        showDropDowns={true}
        readOnlyHeadings={true}
        onSelectedItemsChange={this.onSelectedItemsChange}
        selectedItems={this.state.selectedItems}
       />

现在选择的项目已从SectionedMultiSelect items中排除,而无需使用style对象进行隐藏

© www.soinside.com 2019 - 2024. All rights reserved.