Xóa bài viết
Bạn có chắc chắn muốn xóa bài viết này không ?
Xóa bình luận
Bạn có chắc chắn muốn xóa bình luận này không ?
Dismiss keyboard on React Native: Tắt keyboard khi chạm ra ngoài TextInput
Dismiss keyboard on React Native: Tắt keyboard khi chạm ra ngoài TextInput
import React, { Component } from 'react';
import { TouchableWithoutFeedback, View, TextInput } from 'react-native';
import dismissKeyboard from 'react-native/Libraries/Utilities/dismissKeyboard';
export default class LoginForm extends Component {
constructor(props) {
super(props);
this.state = { text: 'Useless Placeholder' };
}
render () {
return (
<TouchableWithoutFeedback style= { { flex:1}} onPress={dismissKeyboard}>
<View style= { { flex:1}}>
<TextInput
multiline={true}
style= { { height: 100, borderColor: 'gray', borderWidth: 1, marginTop: 100}}
value={this.state.text}
/>
</View>
</TouchableWithoutFeedback>
);
}
}
trungpv1601 15-03-2017
Bình luận

{{ comment.user.name }}
Bỏ hay
Hay

Cùng một tác giả

4
0
Cài đặt môi trường cho laravel dùng docker 1. Cài đặt laravel composer createproject preferdist laravel/laravel blog 2. Tạo file dockercom...

3
0
(Link) 0. Tạo user trên Remote Server sudo adduser deployer sudo usermod aG wwwdata deployer sudo chfn o umask=022 deployer sudo chown deplo...

2
0
Đổi tên project React Native Sửa tên trong file app.json Xoá thư mục ios/ và android/ Chạy lệnh: reactnative eject Chạy lệnh reactnative li...
Bài viết liên quan

19
3
(Link) (Link) — tracks device battery state. (Link) (Link) — tracks geo location state of user's device. (Link) (Link) — tr...