Используйте position: 'absolute'
и top
, right
, bottom
и left
для позиционирования ваших Text
export default class ToolText extends Component {
render() {
return (
<View style={styles.toolTextContainer}>
<Image
style={styles.image}
source={{
uri:
'http://www.pngpix.com/wp-content/uploads/2016/10/PNGPIX-COM-Mickey-Mouse-PNG-Transparent-Image-1-500x575.png',
}}
/>
<Text style={styles.text1}>Sample Text 1</Text>
<Text style={styles.text2}>Sample Text 2</Text>
</View>
);
}
}
стилей
text1: {
position: 'absolute',
top: 2,
left: 8,
},
text2: {
position: 'absolute',
top: 12,
left: 16,
},
toolTextContainer: {
position: 'relative',
color: 'white',
justifyContent: 'center',
},
image: {
width: 50,
height: 50,
},
Демо