有权访问iPhone 8和iPhone X的任何人都可以告诉我型号名称吗?可以通过UIDevice.current.modelName
访问它。
答案 0 :(得分:2)
@Anbu提到的信息是:
请记住,如果您想使用$(document).ready(function() {
$uploadCrop = $('#cb').croppie({
enableExif: true,
viewport: {
width: 250,
height: 250,
/*type: 'circle'*/
},
boundary: {
width: 300,
height: 300
}
});
$('#file1').on('change', function() {
var reader = new FileReader();
reader.onload = function(e) {
$uploadCrop.croppie('bind', {
url: e.target.result
}).then(function(){
console.log('jQuery bind complete');
});
}
reader.readAsDataURL(this.files[0]);
});
//THIS OPENS A MODAL SCREEN THAT ALLOWS THE CROPPING OF SELECTED IMAGE
$('#cropBtn').on('click', function(e) {
$uploadCrop.croppie('result', {
type: 'canvas',
size: 'viewport'
}).then(function (canvas) {
// This is the code that passes the result to another image file which will then be used to produce a new image file to save in to the directory for a particular user account profile photo.
$('.profilePic').attr('src', canvas);
});
});
});
,则需要创建自己的扩展程序,因为这不是UIDevice.current.modelName
中的默认值。