【问题标题】:Image in alertview is not working in ios7alertview 中的图像在 ios7 中不起作用
【发布时间】:2014-07-11 09:43:27
【问题描述】:

我使用以下代码在警报视图中添加图像。但它不起作用。

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 objective-c ios7


【解决方案1】:

你不能在 iOS 7 中使用addSubview 到 UIAlertView。如果你想自定义它,你必须制作你自己的 alertView。网上也有很多自定义的警报视图。你可以试试这个one

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-21
    • 2014-02-06
    • 1970-01-01
    • 2014-11-11
    相关资源
    最近更新 更多