简体   繁体   English

如何改变 react-native-dropdown-picker 的扩展方向

[英]How to change direction of expanding of react-native-dropdown-picker

Picker works fine, but when it placed bottom of screen, it suppose to expand items upwards, but still goes down..选择器工作正常,但是当它放置在屏幕底部时,它应该向上扩展项目,但仍然下降..

I checked to documentation but couldnt find a way?我检查了文档但找不到方法? Is there anyone here how to do it?有人在这里怎么做吗?

screenshot:截屏: 在此处输入图像描述

Component:零件:

<View style={{flex: 1}}>
        <MapView
          provider={PROVIDER_GOOGLE}
          style={[styles.map]}
          loadingEnabled
          initialRegion={initialLocation}
          ref={mapRef}>
          {location && (
            <Marker coordinate={location}>
              <Image
                style={{
                  width: 40,
                  height: 40,
                  margin: 5,
                }}
                source={require('../../assets/icons/marker_icon.png')}
              />
            </Marker>
          )}
          
        </MapView>
        <View style={{flex: 1, justifyContent: 'flex-end', width: '50%'}}>
          <DropDownPicker
            items={allTowns}
            multiple={true}
            multipleText="%d bölge seçildi."
            min={0}
            max={10}
            defaultValue={country}
            containerStyle={{height: 40}}
            itemStyle={{
              justifyContent: 'center',
              alignItems: 'center',
            }}
            onChangeItem={(item) => alert(item)}
          />
        </View>
      </View>

In the documentation, under Advanced > DropDown Box it mentions the props 'dropDownDirection'文档中,在 Advanced > DropDown Box 下,它提到了道具“dropDownDirection”

To make it go up, you must set it to 'TOP' (case is important)要使其 go 向上,您必须将其设置为“TOP”(大小写很重要)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM