1. self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"timeline_retweet_background"]]; 直接平铺一张图片
2.调用
- (void)drawRect:(CGRect)rect {
[[UIImage imageNamed:@"timeline_retweet_background"] drawInRect:rect];
}
3.更改UIView的继承关系 使其继承UIImageView,在添加图片
最后
以上就是酷酷斑马最近收集整理的关于给UIView添加背景图片的方法的全部内容,更多相关给UIView添加背景图片内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复