我正在使用以下代码来显示TextInput组件,希望当value
为空字符串时,边框区域的宽度将为0,但它看起来如下:
知道为什么吗?
这是代码:
<View style={{ justifyContent: 'center', alignItems: 'flex-start',
borderWidth: 1, width: 200, height: 40, paddingLeft: 5 }}>
<TextInput style= {{ height: 20, fontSize: 14, padding: 0,
minWidth: 0, maxWidth: 180,
borderColor: 'red', borderWidth: 1 }}
placeholder = ''
value={inputText}
selectionColor={'#000'}
textContentType="name"
onChangeText={(text) => onSearchChange(text)}
onBlur={onSearchBlur}
onFocus={onSearchFocus}
editable = {true}
maxLength = {50} />
</View>