아마도 사용자 정의 툴팁 구성 요소를 만들 수 있습니다. https://codepen.io/vtisnado/pen/WEoGey
class SampleApp extends React.Component {
render() {
return (
/******************* RENDER VISUAL COMPONENTS *******************/
<View style={styles.container}>
<View style={styles.mainView}>
{/* Start: Tooltip */}
<View style={styles.talkBubble}>
<View style={styles.talkBubbleSquare}>
<Text style={styles.talkBubbleMessage}>Put whatever you want here. This is just a test message :)</Text>
</View>
<View style={styles.talkBubbleTriangle} />
</View>
{/* End: Tooltip */}
<View style={styles.anotherView} /> {/* The view with app content behind the tooltip */}
</View>
</View>
/******************* /RENDER VISUAL COMPONENTS *******************/
);
}
}
/******************* CSS STYLES *******************/
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
},
mainView: {
flex: 1,
flexDirection: 'row',
},
talkBubble: {
backgroundColor: 'transparent',
position: 'absolute',
zIndex: 2, // <- zIndex here
flex: 1,
left: 20,
//left: (Dimensions.get('window').width/2) - 300, // Uncomment this line when test in device.
bottom: 60,
},
talkBubbleSquare: {
width: 300,
height: 120,
backgroundColor: '#2C325D',
borderRadius: 10
},
talkBubbleTriangle: {
position: 'absolute',
bottom: -20,
left: 130,
width: 0,
height: 0,
borderLeftWidth: 20,
borderRightWidth: 20,
borderTopWidth: 20,
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderTopColor: '#2C325D',
},
talkBubbleMessage: {
color: '#FFFFFF',
marginTop: 40,
marginLeft: 20,
marginRight: 20,
},
anotherView: {
backgroundColor: '#CCCCCC',
width: 340,
height: 300,
position: 'absolute',
zIndex: 1, // <- zIndex here
},
});
/******************* /CSS STYLES *******************/
UPDATE : 여기가 일부 CSS의 트릭과 Z- 색인 속성을 사용하여 다른 구성 요소의 전면에 표시되도록하는 방법에 매우 기본적인 예입니다 그것은 일부 사용자를 혼란스럽게 할 수 있기 때문에 나는 Codepen은 iframe 위젯을 제거, 위의 링크를 따라 예제를 확인하십시오.
내 질문을 편집 할 수 있도록 아래쪽 투표에 대한 추리를하십시오. –
저는 수동으로 수행 한 거품을 그릴 수있는 https://github.com/Jpoliachik/react-native-triangle을 사용하고 있습니다. 또한 애니메이션에 반응하는 '반응식 - 애니메이션 - 애니메이션 가능' – jose920405