我有TextInput,它應該是一個邊框,當我試圖定義邊框顏色時,它不會改變,只是保持灰色,爲什麼?爲什麼邊框的顏色不會改變?
這裏是我用來渲染的TextInput邊境代碼:
import React, {Component} from 'react';
import {
StyleSheet, View, Text, Image, TextInput, AppRegistry
} from 'react-native';
class Profile extends Component {
render() {
return (
<View style={styles.profile}>
<View style={[styles.loginRow, {marginBottom: 8}]}>
<TextInput
style={styles.textInputValue}
ref={(ref) => this.password = ref}
onFocus={() => this.password.focus()}
onChangeText={(text) => this.setState({password: text})}
underlineColorAndroid="transparent"
placeholderTextColor="#ffffff"
placeholder='Password'/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
profile: {
padding: 46,
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#f0aa14'
},
loginRow: {
height: 36,
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center',
borderBottomWidth: 1,
borderColor: 'white',
borderRadius:20,
elevation: 1,
marginBottom: 25
},
textInputValue: {
flex: 1,
alignSelf: 'center'
}
});
AppRegistry.registerComponent('test',() => Profile);
我希望邊框的彩色應該是白色的,但它是灰色的,如何解決呢?
這是我想什麼有:
你能添加更多的代碼嗎?爲了追蹤用戶界面問題,重建它非常重要,並且知道到底發生了什麼 – vanBrunneren
@vanBrunneren剛剛添加了更多代碼 –