css3 - How to display inner shadow in <TextInput> tag? -
how inner shadow below image. using below code outer shadow. how can inner shadow ? in advance.
<view style={styles.searchbar}> <textinput placeholder={'suchen...'} style={styles.inputsearch} onchangetext={t => this.setstate({ text: t })} value={text} onsubmitediting={this.onsearch} /> <touchableopacity style={styles.clearbutton} onpress={this.onclear}> <image source={images.cancelsmall} /> </touchableopacity> </view>
styles :
searchbar: { flexdirection: 'row', borderwidth: 0.1, bordercolor: 'grey', flex: 1, height: 40, borderradius: 40, backgroundcolor: '#fafafa', shadowcolor: 'rgba(0, 0, 0, 0.05)', shadowoffset: { width: 2, height: 3 }, shadowradius: 6, shadowopacity: 1 }, inputsearch: { paddingleft: 10, height: 44, flex: 1 }
you can use react-native-shadow has inset option
import { bordershadow } 'react-native-shadow' render = () => { const shadowopt = { width:160, height:170, color:"rgba(0, 0, 0, 0.05)", border:2, inset: true, style:{marginvertical:5} } return ( <bordershadow setting={shadowopt}> <textinput placeholder={'suchen...'} style={styles.inputsearch} onchangetext={t => this.setstate({ text: t })} value={text} onsubmitediting={this.onsearch} /> <touchableopacity style={styles.clearbutton} onpress={this.onclear}> <image source={images.cancelsmall} /> </touchableopacity> </bordershadow > ) }
Comments
Post a Comment