“Bereaksi TextInput Native Nonaktifkan keyboard” Kode Jawaban

TextInput Nonaktifkan Bereaksi Asli

<TextInput editable={false} selectTextOnFocus={false} />
Adventurous Addax

bereaksi asli menonaktifkan input teks

<TextInput editable={false} />
amit.bhagat

bereaksi teks asli tidak ada keyboard

<TouchableWithoutFeedback onPress={Keyboard.dismiss} >
    <TextInput />
</TouchableWithoutFeedback>
Friendly Finch

Bereaksi TextInput Native Nonaktifkan keyboard

<Text>

</Text>
development development

Bereaksi TextInput Native Nonaktifkan keyboard

            // Step 1: Get Keyboard, TouchableWithoutFeedback from ‘react-native’;
            import { View, TextInput, StyleSheet, Keyboard,  TouchableWithoutFeedback } from 'react-native';

            // Step 2: Create an arrow function to write dismiss keyboard code
            const DismissKeyboard = ({ children }) => (
                <TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
                    {children}
                </TouchableWithoutFeedback>
                );

            // Step 3: Wrap all TextInput inside <DismissKeyboard> </DismissKeyboard>
            //Example
            <DismissKeyboard>
                <View style={styles.container}>
                    <TextInput style={styles.input} placeholder="email" />
                    <TextInput style={styles.input} placeholder="password" />
                </View>
            </DismissKeyboard>
Dead Dotterel

Jawaban yang mirip dengan “Bereaksi TextInput Native Nonaktifkan keyboard”

Pertanyaan yang mirip dengan “Bereaksi TextInput Native Nonaktifkan keyboard”

Lebih banyak jawaban terkait untuk “Bereaksi TextInput Native Nonaktifkan keyboard” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya