N
N
Nikita Vereshchagin2022-03-03 21:20:06
React Native
Nikita Vereshchagin, 2022-03-03 21:20:06

How to make ScrollToInput?

return(
        
        <KeyboardAwareScrollView 
        scrollEnabled={true} contentContainerStyle={styles.container} style={{flex:1}}>
        <TextInput value = {Nickname} onChangeText={setUsername} textAlign= 'center' placeholder='Username' maxLength={16} style={styles.input}/>
        <TextInput value = {Password} onChangeText={setPassword} autoFocus={false} secureTextEntry={true} placeholder='Password' textAlign= 'center' maxLength={32} style={styles.input}/>
        <TextInput value = {Firstname} onChangeText={setFirstname}  autoFocus={false} textAlign= 'center' placeholder='Firstname' maxLength={16} style={styles.input}/>
        <TextInput value = {Lastname} onChangeText={setLastname} autoFocus={false} placeholder='Lastname' textAlign= 'center' maxLength={32} style={styles.input}/>
        <TextInput value = {Middlename} onChangeText={setMiddlename} autoFocus={false} placeholder='Middlename' textAlign= 'center' maxLength={32} style={styles.input}/>
        <TextInput value = {Email} onChangeText={setEmail} autoFocus={false} placeholder='Email' textAlign= 'center' maxLength={32} style={styles.input}/>
        <TextInput value = {Permission} onChangeText={setPermission} autoFocus={false} placeholder='Permission' textAlign= 'center' maxLength={32} style={styles.input}/>
        <TextInputMask
            type={'datetime'}
            options={{
                format: 'DD/MM/YYYY'
            }}
            style={styles.input}
            value={date.text}
            onChangeText={text => setDate({text: text})}/>
        

        <TouchableOpacity onPress={()=>Registration(userData, accesToken)}>
        <Text style = {styles.text}>Зарегистрировать</Text>
        </TouchableOpacity>

        </KeyboardAwareScrollView>
       
            
        
    )

A bunch of examples on the Internet, but ... with classes. I have only functions, so there are no this's. How to do it using functional components?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question