关于设置UIView的背景为图片的方法以及问题
UIImageView* imageView = [[UIImageView alloc] initWithFrame:view.bounds]; imageView.image = [[UIImage imageNamed:@"name.png"] stretchableImageWithLeftCapWidth:left topCapHeight:top]; [view addSubview:imageView];
?
这种方式,如果原始图片大小不够(小于view的大小),可以拉伸,在view释放后也没有什么内存保留。
二.通过图片来生成UIColor设置view的backgroundColor
? 1.imageNamed方式
??