我正在使用TextInput
,但是当我点击TextInput
时,我的屏幕会稍微向上移动。
如何阻止这种情况发生?
这是我的TextInput
<TextInput style={{ height:45, borderBottomColor: '#FFFFFF', flex:1,}}
placeholder="Email"
keyboardType="email-address"
underlineColorAndroid='black'
onChangeText={(email) => this.setState({email})}/>
答案 0 :(得分:0)
这是我的代码
function readURL(input,index) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#user_img_preview').attr('src', e.target.result); // You can show image preview before submit
}
reader.readAsDataURL(input.files[0]);
}
}
$("#user_img").change(function (e) {
// Check file is image or not
var file, img;
if ((file = this.files[0])) {
var fileName = this.files[0]['name'];
var idxDot = fileName.lastIndexOf(".") + 1;
var extFile = fileName.substr(idxDot, fileName.length).toLowerCase();
if (extFile=="jpg" || extFile=="jpeg" || extFile=="png"){
readURL(this,1);
img = new Image();
img.onload = function () {
if(this.width != 100 || this.height != 110) {
alert('Please upload proper image with exact size : 100 x 110');
}
};
img.src = _URL.createObjectURL(file);
}else{
alert('Only jpg/jpeg and png files are allowed!');
}
}
});