我正在创建一个多行 UIAlertView,但是由于某种原因,UIAlertView 的宽度对于我的一个 NSString 来说太小了,所以它会插入一个换行符并将错误上升到两行......
这就是我的代码的样子
e
lse if ((checkCustomerName == NO)||(checkCustomerEmail == NO)||(checkCustomerRating == NO)||(checkBranchID == NO)||(checkServerAddress == NO)||(checkPortNumber == NO)||(nameTextField == NO)||(emailTextField == NO)) {
NSMutableString *alertString = [[NSMutableString alloc] init];
if (checkCustomerName == NO) {
[alertString appendString: @"invalid name \n"];
}
if (checkCustomerEmail == NO) {
[alertString appendString: @"invalid e-mail \n"];
}
if (checkCustomerRating == NO) {
[alertString appendString: @"Select a slimey to define your experiance \n"];
}
if (checkBranchID == NO) {
[alertString appendString: @"invalid BranchID \n"];
}
if (checkServerAddress == NO) {
[alertString appendString: @"invalid Server address \n"];
}
if (checkPortNumber == NO) {
[alertString appendString: @"invalid port address \n"];
}
if (nameTextField == NO) {
[alertString appendString: @"invalid name, too many characters \n"];
}
if (emailTextField == NO) {
[alertString appendString: @"invalid e-mail, too many characters \n"];
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Errors" message:alertString delegate:self cancelButtonTitle:nil
otherButtonTitles:@"OK", nil];
[alert show];
}
这是文本的显示方式
错误
无效的名称无效的电子邮件选择一个笑脸来定义您的体验//这是它出错的地方......它应该在同一行
所以我想知道的是如何使该文本出现在同一行,例如如何使uialerview更宽