2
我的UITextView委託方法沒有觸發。UITextView委託方法沒有觸發
UILabel *fieldLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 290, 20)];
fieldLabel.text = nodeproperty.name;
[rowsInSectionLabels addObject:fieldLabel];
UITextView *textViewStatus = [[UITextView alloc] initWithFrame:CGRectMake(5, 25, 290, 30)];
[textViewStatus setTextAlignment:UITextAlignmentLeft];
// For the border and rounded corners
[[textViewStatus layer] setBorderColor:[[UIColor lightGrayColor] CGColor]];
[[textViewStatus layer] setShadowColor:[[UIColor grayColor] CGColor]];
[[textViewStatus layer] setBorderWidth:1];
[[textViewStatus layer] setCornerRadius:5];
[textViewStatus setClipsToBounds: YES];
textViewStatus.delegate = self;
[textViewStatus setEditable:YES];
我的接口
@interface WorkflowViewController : UIViewController <UITextFieldDelegate, UITextViewDelegate, UITableViewDataSource, UITableViewDelegate, UIPickerViewDelegate, UIPickerViewDataSource, PickerRowSelected>
我這裏補充一個斷點,並沒有什麼...
- (void)textViewDidBeginEditing:(UITextView *)textView
{
MultilineTextViewController *multiLineText = [[MultilineTextViewController alloc] init];
[self presentModalViewController:multiLineText animated:YES];
}
任何想法?
我所有的其他委託方法工作完全
鍵盤是否顯示?你有斷點嗎?你有沒有實現' - (BOOL)textViewShouldBeginEditing:(UITextView *)textView'返回YES?這不是壞事,但你可以嘗試,如果它被解僱。 – 2012-03-27 09:25:40
鍵盤顯示出來,我可以鍵入UITextView,即使該委託方法不會被解僱,是斷點被啓用,我還有其他的斷點也在該視圖中,我趕上 – Armand 2012-03-27 09:34:49
這個textView是如何添加到視圖的WorkflowViewController?看來你是以編程方式進行的。你有沒有提及它(財產,iVar)? – 2012-03-27 09:45:52