我首先使用“ [UIAlertView alloc] initWithTitle:
”来调整AlertView
图像大小和自定义,但失败了。
然后我使用以下代码,一切正常(alertView 调整大小并带有图像),但只是不能有一个按钮来关闭 alertView。在这里卡了半天。请帮忙,谢谢!
UIAlertView* find = [[[UIAlertView alloc] init]initWithFrame:CGRectMake(0,0,300,420)];
[find setDelegate:self];
[find setTitle:@"Sample Alert"];
[find setNeedsLayout];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(220, 10, 80, 80)];
NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"111.png"]];
UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path];
[imageView setImage:bkgImg];
[bkgImg release];
[path release];
[find addSubview:imageView];
[imageView release];
[find show];
find.frame = CGRectMake(0,0,300,200);
[find release];