iOS的多行文本框下面是我的代碼的UITextField - 上AlertView
我加入的UITextField到alertview,我需要的是得到從陣列中的數據與多行的UITextField,應該是可編輯的。
NSString *selected = [lineItemsArray objectAtIndex:indexPath.row];
UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"Notice" message:@"Selected" preferredStyle:UIAlertControllerStyleAlert];
[controller addTextFieldWithConfigurationHandler:^(UITextField *linetextField)
{
linetextField.text=selected;
}];
UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"Okay"
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *action) {
[self.navigationController popViewControllerAnimated:YES];
NSLog(@"Dismiss button tapped!");
}];
[controller addAction:alertAction];
[self presentViewController:controller animated:YES completion:nil];
PackageLineItemViewController *pLineVC = [[PackageLineItemViewController alloc]init];
pLineVC.view.backgroundColor = [UIColor whiteColor];
[self.navigationController pushViewController:pLineVC animated:YES];
[self.view endEditing:YES];
檢查此https://github.com/wimagguc/ios-custom-alertview – kb920
我需要的本地方法 –