This is my current code..
I am totally new to react native..please help.
import React from 'react';
import { StyleSheet, Text, View, TextInput,StatusBar, SafeAreaView,Image,Button,Alert} from 'react-native';
export default function App() {
return (
<SafeAreaView>
<View style={styles.container}>
<TextInput
placeholder="Search"
style={styles.searchbox}
></TextInput>
<View style={styles.makecentral} >
<Image
style={styles.tinyLogo}
source={require('./assets/icons8_search_200px_3.png')}
/>
</View>
</View>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#fff',
},
searchbox:{
backgroundColor:'#f2f2f2',
marginTop : StatusBar.currentHeight+5,
height : 50,
marginLeft:10,
marginRight : 10,
borderRadius : 20,
textAlignVertical:'center',
textAlign : 'center',
alignItems:'center',
},
tinyLogo: {
position : 'absolute',
width: 30,
height: 30,
opacity: 0.5,
marginTop: -40,
},
makecentral: {
alignItems:'center',
marginRight:80,
}
});
I want to hide the search image by pressing text input.
I have an image in search box and I want to hide that image when the user touch text input.