I am trying to display some details in my app.
My Code:
<View style={styles.productDetails}> <Text style={styles.ProductName}>Product Name </Text> <Text style={styles.ProductName}> Rs: 200</Text> </View>
Here I have displayed the Product name and Product price, both were displayed left from the page. I want to display the Product name from the Left and the Product price from the right. How can I display it in my React Native App?
My Stylesheet Code:
productDetails: { marginTop: 10, flexDirection: 'row', }, ProductName: { color: '#62d0f1' },
Apply this code:
View:
<View style={styles.productDetails}> <Text style={styles.ProductName}>Product Name </Text> <Text style={styles.ProductPrice}> Rs: 200</Text> </View>
Stylesheet:
productDetails: { marginTop: 10, flexDirection: 'row', }, ProductName: { color: '#62d0f1' }, ProductPrice: { color: '#62d0f1', position: 'absolute', right: 10 },
Question and answer is powered by AnsPress.io