Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native TouchableOpacity内的绝对定位视图不会显示在React Native中_React Native - Fatal编程技术网

React native TouchableOpacity内的绝对定位视图不会显示在React Native中

React native TouchableOpacity内的绝对定位视图不会显示在React Native中,react-native,React Native,当我将视图包装在TouchableOpacity中时,它不再显示,如下所示 <TouchableOpacity onLongPress={() => { console.log("LONG PRESS ...."); }} > <View style={{ ...styles.event, left: left, top:

当我将视图包装在TouchableOpacity中时,它不再显示,如下所示

<TouchableOpacity
   onLongPress={() => {
      console.log("LONG PRESS ....");
   }}
>
          <View
            style={{
              ...styles.event,
              left: left,
              top: top,
              height: height,
              width: width,
              borderRadius: 5,
              backgroundColor: chooseColor(event.activityType, event.calendar),
              opacity: event.calendar == 0 ? 1.0 : 0.5
            }}
          />
</TouchableOpacity>
{
控制台日志(“长按…”);
}}
>

不要用TouchableOpacity包装视图。反向操作。

删除视图并将视图样式添加到TouchableOpacity。我的意思是在TouchableOpacity中传递样式道具,而不是在视图中。仍然不工作!