请先查看我的代码:
<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
应用中却无法工作,其后有一个按钮,因此该按钮被按下但无法按下前按钮。