android - TextInput 在 android 中不起作用 react native

标签 android react-native

当我点击输入并开始输入时,android 中的 TextInput 不工作,没有文本显示为输入。我在 android 8.1 和 7.1 上测试过它。

react-native-cli : 2.0.1 react native :0.55.4

class LoginForm extends Component{
    state={text: ''};
    render(){

        return(
            <Card>
                <CardSection>
                    <TextInput
                        value={this.state.text}
                        onChangeText={(text)=>this.setState({text})}

                        style={{height: 20, width: 1.0}}
                    />
                </CardSection>
                <CardSection/>

                <CardSection>
                    <Button>Log In</Button>
                </CardSection>
            </Card>
        );
    }
}

最佳答案

我们可以给 padding: 0;。 对我来说它工作正常。

关于android - TextInput 在 android 中不起作用 react native ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50317504/

相关文章:

javascript - 如何使加载程序在 View 上居中

java - Wifi和3G同时

android - ColorPicker 对话框未在 android 中显示

javascript - ReactNative ListView 设置加载数据后的初始滚动位置

javascript - .catch 前面的点是什么? (firebase auth, react native)

ios - 在 webview 中检测触摸是 Apple Pencil 还是手指( react native )

reactjs - 安装 React 时出错

android - 将 Edittexts 提示文本样式设置为斜体

android - 在android中添加自定义单选按钮

Android ListView 滚动很慢