UIAlertController调整文字对齐 Posted on 2017-01-10 | In iOS开发技术杂谈 | | Visitors 123456789101112UIAlertController* alertVC = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert];UIView *subView1 = alertVC.view.subviews[0];UIView *subView2 = subView1.subviews[0];UIView *subView3 = subView2.subviews[0];UIView *subView4 = subView3.subviews[0];UIView *subView5 = subView4.subviews[0];//取message:UILabel *message = subView5.subviews[1];message.textAlignment = NSTextAlignmentLeft;UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok",nil) style:UIAlertActionStyleCancel handler:nil];[alertVC addAction:cancelAction];[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertVC animated:YES completion:nil];