Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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
Iphone 自动重设网格中的错误_Iphone_Viewdidload_Autoresizingmask - Fatal编程技术网

Iphone 自动重设网格中的错误

Iphone 自动重设网格中的错误,iphone,viewdidload,autoresizingmask,Iphone,Viewdidload,Autoresizingmask,我已经实现了一个小viewDidLoad来显示带有自动调整大小的图片, 但是它不起作用,能不能请人帮我说一下这个错误在哪里 第3行和第4行中的代码 imageView = [[UIImageView alloc] initWithImage:img]; imageView.frame = self.view.frame; imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight; imageView.aut

我已经实现了一个小viewDidLoad来显示带有自动调整大小的图片, 但是它不起作用,能不能请人帮我说一下这个错误在哪里 第3行和第4行中的代码

imageView = [[UIImageView alloc] initWithImage:img];
    imageView.frame = self.view.frame;
    imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

我希望有人能帮助我?

如果我没弄错的话,你应该用以下方法来做:

imageView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight );
你这样做,你就覆盖了自动重设网格