UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:msg preferredStyle:(UIAlertControllerStyleAlert)];
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"我知道了" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
}];
///設置左對齊
UILabel *label1 = [alertVC.view valueForKeyPath:@"_titleLabel"];
UILabel *label2 = [alertVC.view valueForKeyPath:@"_messageLabel"];
label1.textAlignment = NSTextAlignmentLeft;
label2.textAlignment = NSTextAlignmentLeft;
[alertVC addAction:cancel];
[self presentViewController:alertVC animated:YES completion:nil];
UIAlertController提示消息設置左對齊
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.