imageView不能正确显示图片
2016-12-29 15:46
281 查看
- (void)viewDidLoad {
[super viewDidLoad];
UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"welcome1"]];
image.backgroundColor = [UIColor colorWithRed:0.127 green:0.917 blue:0.170 alpha:0.835];
image.frame = CGRectMake(0, 0, 320,480);
[self.view addSubview:image];
}
welcome1是图片的名称,png格式,模拟器效果如图
适配不是主要问题,问题是图片为什么不显示出来?求解答,感谢
[super viewDidLoad];
UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"welcome1"]];
image.backgroundColor = [UIColor colorWithRed:0.127 green:0.917 blue:0.170 alpha:0.835];
image.frame = CGRectMake(0, 0, 320,480);
[self.view addSubview:image];
}
welcome1是图片的名称,png格式,模拟器效果如图
适配不是主要问题,问题是图片为什么不显示出来?求解答,感谢
相关文章推荐
- ListView的Item高度不确定,导致最后一条item中ImageView 加载图片时不能完全显示
- Problem:ImageView不能显示图片。
- 正确的添加图片方法 - 解决UIImageView.image = UIImage(named: String)不显示图像的问题
- 图片不能显示: [cell.imageView setImageWithURL:imageUrl placeholderImage:nil options:SDWebImageLowPriority
- android imageview 图片不能正常显示 或不能自适应的解决方法
- android imageview 图片不能正常显示 或不能自适应的解决方法
- Widget中使用ImageView显示图片的问题
- Android:ImageView如何显示网络图片
- 同一个ImageView显示不同的图片--->level-listnd
- Android中 在显示ImageView时图片上面和下面都出现一段空白区间的解决办法
- Android中利用OnTouchListener在ImageView中框选显示图片
- 在scrollview里面显示imageview (一张超大图片), scrollview的上下显示多余的空白
- Android中利用OnTouchListener在ImageView中框选显示图片
- Android深入浅出系列之实例应用—简单的手指拖动图片,图片滑来滑去显示应用Gallery和BaseAdapter以及ImageView的使用
- Android应用中在ImageView中显示SD卡上的图片
- background:url(imagepath)不能显示图片
- tableviewcell里面imageview在下载图片之前显示loading,下载后显示指定图片
- Android应用中在ImageView中显示SD卡上的图片
- Android手机开发:ImageView使用和从内存读取图片显示
- Android手机开发:图片的放大和缩小显示ImageView