iOS 修改系统UIAlertController

释放双眼,带上耳机,听听看~!
// 但是据说这种方法会被App Store拒绝(慎用!)
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleActionSheet];
    NSMutableAttributedString *hogan = [[NSMutableAttributedString alloc] initWithString:@"我是一个大文本"];
    [hogan addAttribute:NSFontAttributeName
                  value:[UIFont systemFontOfSize:30]
                  range:NSMakeRange(4, 1)];
    [hogan addAttribute:NSForegroundColorAttributeName
                  value:[UIColor redColor]
                  range:NSMakeRange(4, 1)];
    [alertVC setValue:hogan forKey:@"attributedTitle"];
    
    UIAlertAction *button = [UIAlertAction actionWithTitle:@"Label text" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ }];
    UIImage *accessoryImage = [UIImage imageNamed:@"1"];
    [button setValue:accessoryImage forKey:@"image"];
    [alertVC addAction:button];
    [self presentViewController:alertVC animated:YES completion:nil];

 

人已赞赏
iOS文章

iOS 查看系统所有字体

2020-2-9 18:44:44

iOS文章

iOS 在图片上绘制文字并生成新的图片

2020-2-9 20:08:43

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索