UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@"Atention"

message: @"I'm a Chinese!"

  delegate:nil 

  cancelButtonTitle:@"Cancel" 

  otherButtonTitles:@"Okay",nil] autorelease];

[theAlert show];

/*

for(UIView *view in [theAlert subviews]){

if(view.tag ==1){

view.backgroundColor = [UIColor greenColor];

}

}

*/

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];

相关文章:

  • 2021-11-07
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-05-16
  • 2021-07-04
  • 2022-01-29
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2021-09-19
  • 2022-01-16
  • 2021-12-01
  • 2021-10-28
  • 2022-02-12
相关资源
相似解决方案