[英]Image in alertview is not working in ios7
我使用以下代碼在警報視圖中添加圖像。 但是它不起作用。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Popup" message:@"popup" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];
UIImageView *tempImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"gg.jpg"]];
tempImg.contentMode = UIViewContentModeScaleToFill;
tempImg.frame = CGRectMake(90, 40, 100, 120);
// tempImg.image = [UIImage imageNamed:@"gg.jpg"];
[alert addSubview:tempImg];
[alert show];
提前致謝
您不能在iOS 7中將addSubview
用於UIAlertView。如果要自定義,則必須創建自己的alertView。 網上也有很多自定義的alertview。 你可以試試這一個 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.