शायद आप अपना कस्टम टूलटिप घटक बना सकते हैं। 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 *******************/
अद्यतन: यहाँ कैसे यह कुछ सीएसएस चाल और zindex संपत्ति का उपयोग कर अन्य घटकों के सामने प्रदर्शित करने के लिए में एक बहुत ही बुनियादी उदाहरण है मैं Codepen आइफ्रेम विजेट हटा दिया है, क्योंकि यह कुछ उपयोगकर्ताओं को भ्रमित कर सकता है, उदाहरण देखने के लिए उपर्युक्त लिंक का पालन करें।
कृपया डाउन-वोटिंग के लिए तर्क दें ताकि मैं अपना प्रश्न –
संपादित कर सकूं। मैं ड्रग ट्रिंगल और मैन्युअल रूप से किए गए बबल के लिए https://github.com/Jpoliachik/react-native-triangle का उपयोग कर रहा हूं। एनीमेशन देने के लिए 'प्रतिक्रिया-देशी-एनिमेटेबल' भी – jose920405