遍历控件中的label然后修改某些属性
- (void)willPresentAlertView:(UIAlertView *)alertView {
// 遍历 UIAlertView 所包含的所有控件
for (UIView *tempView in alertView.subviews) {
if ([tempView isKindOfClass:[UILabel class]]) {
// 当该控件为一个 UILabel 时
UILabel *tempLabel = (UILabel *) tempView;
if ([tempLabel.text isEqualToString:alertView.message]) {
// 调整对齐方式
tempLabel.textAlignment = UITextAlignmentLeft;
// 调整字体大小
[tempLabel setFont:[UIFont systemFontOfSize:15.0]];
}
}
}
}

浙公网安备 33010602011771号