现在的位置: 首页 > 综合 > 正文

自定义 UIAlertVIew 背景

2013年09月08日 ⁄ 综合 ⁄ 共 397字 ⁄ 字号 评论关闭

UIImage *theImage = [UIImage imageNamed:@"loveChina.png"];    
theImage = [theImage stretchableImageWithLeftCapWidth:0. topCapHeight:0.];
CGSize theSize = [theAlert frame].size;
UIGraphicsBeginImageContext(theSize);    
[theImage drawInRect:CGRectMake(0, 0, theSize.width, theSize.height)];    
theImage = UIGraphicsGetImageFromCurrentImageContext();    
UIGraphicsEndImageContext();
theAlert.layer.contents = (id)[theImage CGImage];

抱歉!评论已关闭.