I am building an App on react native in which I want to be position something from right
<View style={searchDrop}>
<TextInput
style={textInput}
placeholder="Search Coin"
onChangeText={(text) => this.onSearch(text)} />
<TouchableOpacity onPress={() => this.props.navigation.navigate("CurrencySelection")}>
<Text style={money}> <Icons name="money" size={35} color="#fbc02d" /> </Text>
</TouchableOpacity>
</View>
with following styles
textInput: {
width: "70%",
height: 35,
marginLeft: 5,
marginRight: 5,
borderWidth: 0,
backgroundColor: "white",
borderRadius: 15,
textAlign: 'center'
},
searchDrop: {
paddingTop: 32,
paddingBottom: 5,
display: "flex",
flexDirection: "row",
height: 80,
backgroundColor: "#3b5998",
width: 100%
},
money: {
position: "absolute",
right: 0
}
With That I was expecting
<Text style={money}> <Icons name="money" size={35} color="#fbc02d" /> </Text>
To be on the absolute right side of the screen
Here is how it is looking now
Simply do this, it will move the icon to right.
<View style={styles.searchDrop}>
<TextInput
style={styles.textInput}
placeholder="Search Coin"
onChangeText={text => this.onSearch(text)}
/>
<TouchableOpacity
style={styles.money}
onPress={() => this.props.navigation.navigate('CurrencySelection')}>
<Text> <Icons name="money" size={35} color="#fbc02d"/> </Text>
</TouchableOpacity>
</View>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With