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,在添加图片