【问题标题】:Is it possible to use searchableDropdown inside a Modal (react-native)?是否可以在模态(react-native)中使用可搜索的下拉菜单?
【发布时间】:2019-06-06 08:33:47
【问题描述】:

我正在尝试在模式中使用 Searchable Dropdown 来响应本机。如果我“单独”使用它(我的意思是在模式之外)它工作正常。但是如果我把它放在一个模式中,它的属性 onItemSelect 似乎没有工作(它不允许我点击任何东西)

<Modal isVisible={this.state.isBuildingModalVisible}>
                <SearchableDropdown
                  onItemSelect={item => {
                    this.setState({ building_id: item.id });
                  }}
                  containerStyle={{ ...}}
                  textInputStyle={{
                   ...
                  }}
                  itemStyle={{
                   ...
                  }}
                  itemTextStyle={{
                    color: "white",
                    fontSize: (15 / 411.42) * screen
                  }}
                  itemsContainerStyle={{ maxHeight: 140 }}
                  items={this.state.dataSource}
                  placeholder="Choose School"
                  placeholderTextColor="white"
                  underlineColorAndroid="transparent"
                />
                <View
                  style={{
                    alignItems: "center",
                    justifyContent: "center",
                    flexDirection: "row"
                  }}
                >
                  <TouchableOpacity
                    style={styles.button}
                    onPress={this.toggleBuildingModal}
                  >
                    <Text style={{ color: "white" }}>Cancel</Text>
                  </TouchableOpacity>
                  <TouchableOpacity
                    style={styles.button}
                    onPress={() => this.submitpassword()}
                  >
                    <Text style={{ color: "white" }}>Execute</Text>
                  </TouchableOpacity>
                </View>
              </Modal>

【问题讨论】:

    标签: react-native modal-dialog dropdown searchable


    【解决方案1】:

    好的,问题是 react native 不允许你将 SearchableDropdown 放在滚动视图中(如果有人有这个问题:P)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-07-29
      • 2017-01-24
      • 2020-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多