我正在創建一個多行UIAlertView,但由於某種原因,UIAlertView的寬度對於我的NSString之一來說太小,所以它會放入一個換行符,並將錯誤提升到兩行。 。UIAlertView多行警報插入linebreak
這是我的代碼是什麼樣子
Ë
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];
}
這是文本如何出現
錯誤
無效的名稱 無效電子郵件 選擇表情符號定義 的experiance //這就是它去錯了......應該是在同一行
所以我想知道的是什麼如何使該文本出現在同一行,例如如何使uialerview更廣泛
如果你想改變這樣的事情你是從頭開始做自己的警報的更好。 UIAlertView並不是真的被設計得太過分了。 – 2013-03-06 02:03:08
那很不幸......好吧謝謝:) – HurkNburkS 2013-03-06 02:04:57