1
如何獲得如下圖像的內部陰影。我使用下面的代碼來獲取外部影子。但是我怎麼能得到內在的影子?提前致謝。如何在<TextInput>標記中顯示內部陰影?
<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>
風格:
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
}
我只是交叉檢查該庫。但似乎沒有什麼對我有用。你可以請發送一些代碼,如何使用插入選項顯示內部陰影? –
我更新了答案,但現在無法測試 –
感謝您的快速回答。我會嘗試一下:) –