第一种方式:
bg = [bg resizableImageWithCapInsets:UIEdgeInsetsMake(10,10,10,10)];//默认是平铺 bg = [bg resizableImageWithCapInsets:UIEdgeInsetsMake(10,10,10,10) resizingMode:..];//平铺和拉伸
第二种方式:
bg = [bg stretchableImageWithLeftCapWidth: topCapHeight:]; 把官方计算拷贝 // 1 == width - leftCapWidth - right cap // 1 == height - topCapWidth - bottom cap // 只拉伸1*1的像素