zoukankan      html  css  js  c++  java
  • UIAlertController 标题文字大小 颜色

    NSString *title = [NSString stringWithFormat:@"
    恭喜您获得%d个红包
    ", 10];
        NSString *msg = @"
    把红包分享给微信好友,金额随机,可用于购买雪票和雪卡";
        UIAlertController * alert = [UIAlertController alertControllerWithTitle:title
                                                                        message:msg
                                                                 preferredStyle:UIAlertControllerStyleActionSheet];
    // titile字号处理
        NSMutableAttributedString *hogan = [[NSMutableAttributedString alloc] initWithString:title];
        [hogan addAttribute:NSFontAttributeName
                      value:[UIFont systemFontOfSize:20.0]
                      range:NSMakeRange(0, title.length)];
        [alert setValue:hogan forKey:@"attributedTitle"];
    //
        
        UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"给好友发红包" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            [self shareAction];
        }];
        [alert addAction:sureAction];
        
    
        alert.view.tintColor = APP_MAIN_COLOR;
        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消"
                                                               style:UIAlertActionStyleCancel
                                                             handler:nil];
        [alert addAction:cancelAction];
        
        [self presentViewController:alert animated:YES completion:nil];
  • 相关阅读:
    poj2352树状数组
    hdu1166树状数组
    poj2785双向搜索
    poj2566尺取变形
    poj2100还是尺取
    poj3061尺取法
    poj3320尺取法
    hdu3829最大独立集
    poj2594最小顶点覆盖+传递闭包
    经典换根dp——hdu2196
  • 原文地址:https://www.cnblogs.com/songxing10000/p/5148402.html
Copyright © 2011-2022 走看看