Change background color of a UIAlertView
2010-02-08 15:38
381 查看
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];
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];
相关文章推荐
- 如何修改Screen背景?How to - Change the background color of a screen
- Change the background color of the header of a List Control
- How To Change the Background Color of a Tab Control
- How to change background color of gedit embedded terminal
- (Sharepoint 2010) Change the background and font color of text for a web part header
- how to change the background color of actionbar
- qt 之 How to Change the Background Color of QWidget
- How to change the background color of form using C++ - 如何用C++改变窗体的颜色
- Click Button to change the color of TextView
- How to change the background color of an Edit Box
- In Delphi XE2 FireMonkey - How do i change the color of a button after pressing it
- Android—ViewPager: Can't Change Tag of Fragment
- self.tableView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.3];
- How can I set the background of UITableView (the tableview style is "Grouped") to use an image?
- how to change the background of actionbar.tab
- 蒙板_upView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
- Android报错ViewPager: Can't Change Tag of Fragment的解决方法
- 一种不错的浅灰色 [UIColor groupTableViewBackgroundColor]
- Preserving the state of an Android WebView on screen orientation change
- Change Rows Background color in GridView with selected Criteria