It's very simple and there's two ways of doing it
Alternative one:
<View style={{justifyContent: "flex-end", height: 150, width: 150}}>
<Image style={{flex: 1, height: 50}} source={require("imageUri")} />
</View>
This does not position the image absolutely and will not overflow other content, if some other child component gets declared under the current Image
component, it will move the first one up and the new child component will be positioned in the bottom.
Alternative two:
<View style={{justifyContent: "flex-end", height: 150, width: 150}}>
<Image
style={{
flex: 1,
height: 50,
position: "absolute",
bottom: 0,
left: 0,
zIndex: 33
}}
source={require("imageUri")}
/>
</View>
The Image component does in fact become absolutely positioned bottom. If the zIndex
property is greater than any of the other components default or modified zIndex
value, the component will overlap and render above the other components. It will hide the content under the image, just like in CSS.
Alternative three:
<View style={{justifyContent: "space-between", height: 150, width: 150}}>
<Image style={{flex: 1, height: 50}} source={require("imageUri")} />
<Image style={{flex: 1, height: 50}} source={require("imageUri")} />
</View>
This method is used to create even spacing between all child components. The last child component will be positioned bottom but not absolutely. This is good only when you want either a component on the top and bottom and also if you want a third component positioned in the middle. You can add as many as you want, this method will only be useful if you don't declare too many child components with a total height that exceeds the container height.
It also depends on what you're trying to achieve. If you're creating some sort of brand or logo watermark, choose the absolutely positioned method. If not, choose the first alternative. Then again, use the third alternative if you want other objects evenly spaced between the top and bottom components.