gpt4 book ai didi

android - 如何在 React Native 中将 TextInput 中的输入大写?我无法通过 TextField 的 autoCapitalize 属性将句子、单词或字符大写

转载 作者:行者123 更新时间:2023-11-30 00:42:01 27 4
gpt4 key购买 nike

import React, { Component } from 'react';   
import { AppRegistry, Text, TextInput, View } from 'react-native';

class PizzaTranslator extends Component {
constructor(props) {
super(props);
this.state = {text: ''};
}
render() {
return (
<View style={{padding: 10}}>
<TextInput
style={{height: 40}}
placeholder="Type here to translate!"
autoCapitalize="characters"

here autoCapitalize doesnt works on my android.

        autoFocus="true"
onChangeText={(text) => this.setState({text:text})}
/>
<Text style={{padding: 10, fontSize: 42}}>
{this.state.text.split(' ').map((word) => word && '🍕').join(' ')}
</Text>
</View>
);
}
}

AppRegistry.registerComponent('testapp', () => PizzaTranslator);

I have samsung galaxy S6 with marshmallow api level 23 and i am currently testing on that. This autocapitalize works on other android but not on mine . I just noticed this. Does mobile effects the property?

最佳答案

我注意到这只发生在我的三星默认键盘上。我下载了另一个键盘,autoCapitalize 在其他键盘上工作。

关于android - 如何在 React Native 中将 TextInput 中的输入大写?我无法通过 TextField 的 autoCapitalize 属性将句子、单词或字符大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42409400/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com