NSString
*message =
NSLocalizedString
(
@"新版本手机办公上线,请前往http://www.baidu.com下载安装访问,旧版系统即日起停用。给您带来的不便,敬请谅解!"
,
nil
);
NSString *title = @"尊敬的各位领导同事\n" ;
NSString *title = @"尊敬的各位领导同事\n" ;
UIAlertController *alertController = [ UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
//改变message的大小和颜色
NSMutableAttributedString
*messageAtt = [[
NSMutableAttributedString
alloc] initWithString:message];
//设置需要改变颜色字体的开始位置 和结束位置
[messageAtt
addAttribute
:
NSForegroundColorAttributeName
value:[UIColorblueColor] range:NSMakeRange(13, 20)];
[alertController setValue:messageAtt forKey:@"attributedMessage"];
UIAlertAction
*alertAction = [
UIAlertAction
actionWithTitle:NSLocalizedString(@"前往",nil) style:UIAlertActionStyleCancelhandler:nil];
[alertController
addAction
:alertAction];
[
self
.
window
.
rootViewController
presentViewController:alertController animated:YEScompletion:nil];