English 中文(简体)
改变背景 观点,我正在得到警告: 定型
原标题:changing background color of UIAlertView , I am getting Warning : No -setContents method found
  • 时间:2009-10-16 06:22:46
  •  标签:

Warning : No -setContents method found. messages without a matching method signature will be assumed to return id and accept ... as arguments ....

This crashes my version of it. Can someone help me to solve it?

守则如下:

UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@"Atention"
   message: @"YOUR MESSAGE HERE", nil)
   delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease];

[theAlert show];

UILabel *theTitle = [theAlert valueForKey:@"_titleLabel"];
[theTitle setTextColor:[UIColor redColor]];

UILabel *theBody = [theAlert valueForKey:@"_bodyTextLabel"];
[theBody setTextColor:[UIColor blueColor]];

UIImage *theImage = [UIImage imageNamed:@"Background.png"];    
theImage = [theImage stretchableImageWithLeftCapWidth:16 topCapHeight:16];
CGSize theSize = [theAlert frame].size;

UIGraphicsBeginImageContext(theSize);    
[theImage drawInRect:CGRectMake(0, 0, theSize.width, theSize.height)];    
theImage = UIGraphicsGetImageFromCurrentImageContext();    
UIGraphicsEndImageContext();

[[theAlert layer] setContents:[theImage CGImage]];
最佳回答

增 编

#import <QuartzCore/QuartzCore.h>

页: 1

问题回答

暂无回答




相关问题
热门标签