React Native FlatList более не доступен - PullRequest
0 голосов
/ 10 апреля 2020

Я создал FlatList и добавил Dropdown в заголовок Flatlist. При нажатии на выпадающие опции открываются красиво, но при нажатии на опции это вызывает плоский список. Как решить эту проблему? Заранее спасибо. enter image description here

Плоский список кодов:

                <AnimatedFlatList
              {...this.props}
              data={this._filteredListItems(data)}
              ListHeaderComponent={() =>
                this._renderListHeader(formattedStartDate, formattedEndDate)
              }
              renderItem={this._renderItem}
              contentContainerStyle={{
                flexGrow: 1,
                paddingTop: HEADER_HEIGHT - TABBAR_HEIGHT,
                marginTop: TABBAR_HEIGHT - 16,
                paddingBottom:35,
                marginBottom: 35
              }}
              keyExtractor={(_, index) => String(index)}
              stickyHeaderIndices={[0]}
            />

ListHeaderComponent code:

 <CustomSelect
        value={this.state.selectedTrxType}
        onChange={val =>
        {
          this.setState({ selectedTrxType: val });
        }}
        options={Object.keys(transTypeEnum).map(parseTransTypeCode)}
        style={{ flex: 1 }}
      />

Используемый стиль для контейнера параметров:

  optionsContainer: {
flex: 1,
maxHeight: 180,
backgroundColor: '#fff',
position: 'absolute',
zIndex: 10,
top: 40,
left: 0,
right: 0,
paddingBottom: 8,
borderBottomLeftRadius: 8,
borderBottomRightRadius: 8,
elevation: 2,
shadowColor: '#000',
shadowRadius: 1,
shadowOffset: { width: 0, height: 2 }

}

...