UIAlertController 标题文字大小 颜色
2024-09-19 14:10:46
NSString *title = [NSString stringWithFormat:@"\n恭喜您获得%d个红包\n", ];
NSString *msg = @"\n把红包分享给微信好友,金额随机,可用于购买雪票和雪卡";
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(, 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];
最新文章
- python学习笔记(字符串操作、字典操作、三级菜单实例)
- C程序汇编运行模式简析
- python基础之数据类型(二)
- android surfaceView 黑屏
- C++中,申请字符串数组可用new实现
- Android的Handler几种常见的传值方式
- 正则去掉html标签
- distributor之Interrupt Set/Clear-Active Registers, GICD_IS/CACTIVERn
- keyboard splitting bug on ipad with ios 5 and 6 (Cocos2d-x)
- Essential C#读书笔记
- iOS错误之-Presenting view controllers on detached view controllers is discouraged
- java基础小项目练习之1----3天做出飞机大战
- VIM学习二: VIM配置代码及效果图
- Dear Menuhin
- 为什么90%的CTO 都做不好绩效管理
- canvas-3radialGradient.html
- Solr——Windows下部署Solr6.6.0至Tomcat8.5.28(一)
- day 11 生成器
- linux服务器安装anaconda,然后远程使用jupyter
- 使用python来搞定redis的订阅功能