在我的代码中,我这样做:
imageFormatos = [UIImage imageNamed:@"FondoFormatos"];
formatosImageView.frame = CGRectMake(tempFormatoX, 540, widthFormato, 230);
formatosImageView.contentMode = UIViewContentModeScaleToFill;
formatosImageView.layer.borderWidth=0.0;
[imageFormatos DrawInRect:CGRectMake(formatosImageView.frame.origin.x,formatosImageView.frame.origin.y,formatosImageView.frame.size.width,formatosImageView.frame.size.height)];
formatosImageView.backgroundColor = [UIColor blueColor];
并显示如下:
我设置背景以查看2个视图的大小。我需要黑色图像填充所有imageView。
编辑:好的,它有透明边界,但在Xcode文件检查器中没有显示:
答案 0 :(得分:0)
imageFormatos = [UIImage imageNamed:@"FondoFormatos"];
formatosImageView.frame = CGRectMake(tempFormatoX, 540, widthFormato, 230);
formatosImageView.contentMode = UIViewContentModeScaleToFill;
formatosImageView.layer.borderWidth=0.0;
self.formatosImageView.image= imageFormatos;
formatosImageView.backgroundColor = [UIColor blueColor];
我已更新您的代码,请检查一次