IOS7中的图像背景问题

问题描述:

我在viewcontroller中添加了imageview。
它在ios6中运行良好,但在ios7中显示有白色背景。我试过clearColor但它不工作。
这里是我的代码IOS7中的图像背景问题

[imgcharacter setImage:[UIImage imageNamed:[NSString stringWithFormat:@"character%d.png",reelBtnTag]]]; 

[imgcharacter setFrame:CGRectMake(100,100, 247.5f, 385.0f)]; 
imgcharacter.userInteractionEnabled=YES; 
[imgcharacter setBackground : [UIColor clearColor]];   
[captureview addSubview:imgcharacter]; 
+1

您可以发布您的代码? –

+0

您是否尝试过将contentView backgroundColor设置为clearColor? iOS 7引入了一些以前没有的内容视图属性。 – null0pointer

+0

务实地我在viewcontroller dding imageview。 –

尝试这样....

NSData *imageData = UIImagePNGRepresentation(Your Image); 
    UIImage *image=[UIImage imageWithData:imageData]; 
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 52, 40, 50)]; 
    imageView.backgroundColor = [UIColor clearColor]; 
    imageView.image = image;