我通过以下代码在 UIAlertView 的附件视图中提供 UIImageView:
UIAlertView *alertView = [[UIAlertView alloc]init];
[alertView addButtonWithTitle:@"Cancel"];
[alertView addButtonWithTitle:@"OK"];
UIImageView *someImageView = /*initialization code */;
[someImageView setFrame:CGRectMake(0,0,40 ,20)];
[alertView someImageView forKey:@"accessoryView"];
[alertView show];
上面的代码在 iOS7 上运行良好,但自从更新到 iOS8 后,alertView 看起来被拉长并且迷失方向。我尝试更改 UIImageView 中设置的图像的约束和纵横比。有人可以帮我弄这个吗?