绝对位置框(可触摸不透明度)不起作用。反应本机

时间:2020-11-03 13:07:01

标签: react-native

请先查看我的代码:

<View
  style={{
    maxHeight: 200,
    borderRadius: 0,
    borderWidth: JSON.parse(locations).length ? 1 : 0,
    borderColor: "#ccc",
    top: 0,
    left: 0,
    right: 0,
    backgroundColor: "white",
    position: "absolute",
    zIndex: 121212121212,
  }}
>
  <ScrollView nestedScrollEnabled={true}>
    {JSON.parse(locations).map((data, index) => {
      return (
        <TouchableOpacity
          style={{
            borderBottomWidth: 1,
            borderBottomColor: "#ccc",
            padding: 20,
          }}
          key={"a" + index}
          onPress={() => {
            setShowmodal(false);
            getLoc(data.value, data.name);
          }}
        >
          <Text style={{ color: "#000000", fontSize: 16 }}>{data.name}</Text>
        </TouchableOpacity>
      );
    })}
  </ScrollView>
</View>;

在上面的代码中,TouchableOpacity框在iOS应用中可以正常工作,但在Android应用中却无法工作,其后有一个按钮,因此该按钮被按下但无法按下前按钮。

0 个答案:

没有答案