Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/464.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使工具栏上面的默认键盘与反应本机?_Javascript_Android_Ios_React Native - Fatal编程技术网

Javascript 如何使工具栏上面的默认键盘与反应本机?

Javascript 如何使工具栏上面的默认键盘与反应本机?,javascript,android,ios,react-native,Javascript,Android,Ios,React Native,默认情况下,如何使用React Native在键盘上创建按钮? 我指的是本机键盘的按钮(不要更改键盘,只需添加上面的前缀) 像这样使用键盘避免查看react native中的组件 import React, { Component } from 'react'; import { View, Text, KeyboardAvoidingView, TextInput } from 'react-native'; import { Header } from 'react-native-eleme

默认情况下,如何使用React Native在键盘上创建按钮? 我指的是本机键盘的按钮(不要更改键盘,只需添加上面的前缀)

像这样使用
键盘避免查看
react native
中的组件

import React, { Component } from 'react';
import { View, Text, KeyboardAvoidingView, TextInput } from 'react-native';
import { Header } from 'react-native-elements';

class App extends Component {
    render() {
        return (
            <View style={{ flex: 1, backgroundColor: 'white' }}>
                <Header
                    outerContainerStyles={{ ... }}
                    centerComponent={(
                        <Text style={{ ... }}>
                            Test Screen
                        </Text>
                    )}
                />
                <View style={{ flex: 1 }}>
                    <TextInput
                        style={{ ... }}
                        value={ ... }
                        onChangeText={() => { }}
                    />
                </View>
                <KeyboardAvoidingView
                    behavior='padding'
                    style={{ backgroundColor: '#4099FF' }}
                >
                    <Text>
                        Toolbar
                    </Text>
                </KeyboardAvoidingView>
            </View>
        );
    }
}

export default App;
import React,{Component}来自'React';
从“react native”导入{View,Text,KeyboardAvoidingView,TextInput};
从“react native elements”导入{Header};
类应用程序扩展组件{
render(){
返回(
{ }}
/>
工具栏
);
}
}
导出默认应用程序;
那么你有这个:


如果你的应用程序不是全屏的,你可以在
组件上使用
position:absolute
bottom:0
,你想把它放在键盘上。

现在RN有一个内置的解决方案。