3
我有一個帶有文本框的UIAlertView,顯示默認值和兩個按鈕,一個用於取消,另一個用於確認。我想要做的是,當彈出警報視圖時,默認值將突出顯示,以便用戶可以覆蓋整個值,而不是手動刪除它。如何在UIAlertView文本域內自動突出顯示文本
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Title" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Continue",nil];
[alert addTextFieldWithValue:@"87893" label:@"value"];
UITextField *textField = [alert textField];
campoTexto.highlighted = YES;
campoTexto.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
[alert show];
[alert release];
}
出於某種原因,沒有爲文本框高亮顯示的屬性,但它似乎沒有工作,也沒有類文檔中該屬性的蹤跡。