按下按钮:隐藏键盘in react-native

Din*_*ina 3 reactjs react-native react-native-android

我有这个简单的屏幕

当我按下按钮键盘仍然是apear我该怎么做:"按下按钮:隐藏键盘"?

这是我的按钮代码

        manage = () => {
           const { navigate } = this.props.navigation;
        if (this.state.text.length === 10) {

          navigate('service',{text: this.state.text});
        } else {
        Alert.alert('?????? ????? ?????  ?????? ?????? ?? 10 ?????')
        }
        }
        <Button   title='??????'
           backgroundColor="#C1272D"
   onPress={this.manage}>
  </Button>
Run Code Online (Sandbox Code Playgroud)

Ara*_*d S 7

试试这个

import { Keyboard } from 'react-native'; 

Keyboard.dismiss()//Call where ever you needed
Run Code Online (Sandbox Code Playgroud)

文档在这里