reactjs - How do I make one child of a dom structure rise to the top of the DOM in React Native -


i working on react native project have <view "container" > <image/> <view "toucharea" /> </view> being returned array transforms being applied container view (making inside rotate, seen below). however, aiming have many of these elements , tail end of container view overlaps toucharea , stops me accessing panhandlers.

how make toucharea float top of stack first item selected when touch it?

code:

 

output.push(<view> {/* container entire button */} <view style={[ styles.cursorimagecontainer,    { height: containerwidth, width: strokewidth },   {     transform: [       { translatex: containerwidth/2 - strokewidth/2 },       { rotatez: startangle *57.29582 + "deg" },     ]   } ]}>    {/* first cursor image  */}   <image style={[ styles.image,    { height: containerwidth, width: strokewidth/3 }]}    source={dialcursor}/>    {/* first touch area  */}   <view lineid={k} style={[ styles.cursorimagetoucharea,    { height: strokewidth, width: strokewidth/3 } ]}   {..._starthandler}/> </view>   {/* container entire button  */} <view style={[ styles.cursorimagecontainer,    { height: containerwidth, width: strokewidth },   {     transform: [       { translatex: containerwidth/2 - strokewidth/2 },     { rotate: (startangle+anglelength)*57.29582 + "deg" },   ] }]}>     {/* second cursor image  */}   <image style={[ styles.image,    { height: containerwidth, width: strokewidth/3 }   ]} source={dialcursor}/>     {/* second touch area  */}   <view ref={(k) => this.currentline = k} lineid={k} style={[ styles.cursorimagetoucharea,    { height: strokewidth, width: strokewidth/3 } ]}   {..._endhandler}/>  </view>   </view> ) }) return output;  

stylesheet:

const styles = stylesheet.create({   container: {     // justifycontent: 'center'   },   stackcontainer: {     // position: 'absolute',   },   svgelement: {     position: 'absolute',   },   image: {     position: 'absolute',     resizemode: 'cover'   },   cursorimagetoucharea: {       position: 'absolute',     backgroundcolor: 'red',     opacity: 0.15,   },   cursorimagecontainer: {     position: 'absolute',      alignitems: 'center',   },   text: {     position: 'absolute',     fontsize: 20,   },   textcontainer: {         position: 'absolute',   } }); 

very simple answer own question.

all had use pointerevents={'box-none'} in cursorcontainer view , wrap image in view , give pointerevents={'none'}.

i tried using zindex didnt work children components.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -