Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6214

align placeHolder text in vertical center

$
0
0

The placeholder and typed text in my input field seems to be a bit lower than the center. Is there any way to vertically align it in the center? I have already tried alignItems, justifyContent and textAlign but none of them seem to do the trick.

export const Input: FunctionComponent = () => {  return (<Item rounded style={styles.inputItem}><Icon name='search' size={moderateScale(18)} color="#bdbdbd" style={styles.icon}/><Input        style={styles.inputField}        placeholder="Search Text"        placeholderTextColor="grey"      /></Item>  );};const styles = StyleSheet.create({  inputItem: {    width: moderateScale(330),    backgroundColor: 'white',    borderBottomColor: 'grey',    borderRadius: moderateScale(10),    height: verticalScale(40),    paddingLeft: moderateScale(10),  },  icon: {    paddingRight: moderateScale(10),  },  inputField: {    fontSize: moderateScale(15),    borderBottomColor: 'transparent',    marginTop: 3,  },});

Viewing all articles
Browse latest Browse all 6214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>