Hi All,
In my view am dynamically calling UITextView or UITextField. After calling any one view , when i call the other view both are displaying..ie. am not able to disable my UITextView( for which i have larger view than UITextField). Anyone knowing this please help me...
- (void)viewWillAppearBOOL)animated {
[super viewWillAppear:YES];
self.title = [self.keyOfTheFieldToEdit capitalizedString];
NSString* kk = self.keyOfTheFieldToEdit;
if(kk == @"firstName" || kk == @"lastName" || kk == @"email") {
CGRect frame = CGRectMake(20.0, 68.0, 280.0, 31.0);
UITextField *aTextField = [[UITextField alloc] initWithFrame:frame];
self.textField2 = aTextField;
[aTextField release];
textField2.textAlignment = UITextAlignmentCenter;
textField2.borderStyle = UITextBorderStyleRoundedRect;
textField2.autocapitalizationType = UITextAutocapitalizationTypeWords;
textField2.keyboardType = UIKeyboardTypeNamePhonePad;
textField2.returnKeyType = UIReturnKeyDone;
textField2.delegate = self;
[self.view addSubview:textField2];
textField2.text = self.editValue;
[textField2 becomeFirstResponder];
}
else if(kk == @"note") {
self.textField2.enabled = NO;
CGRect frame = CGRectMake(20.0, 60.0, 280.0, 120.0);
UITextView *aTextView = [[UITextView alloc] initWithFrame:frame];
self.textView = aTextView;
[aTextView release];
textView.backgroundColor = [UIColor whiteColor];
textView.keyboardType = UIKeyboardTypeNamePhonePad;
textView.returnKeyType = UIReturnKeyDone;
textView.delegate = self;
[self.view addSubview:textView];
textView.text = self.editValue;
[textView becomeFirstResponder];
}
here after calling my else if part, when we call if part both are displaying...
when we call else if part after if ,then it is overlapping, so in view there is no problem..
Asif
In my view am dynamically calling UITextView or UITextField. After calling any one view , when i call the other view both are displaying..ie. am not able to disable my UITextView( for which i have larger view than UITextField). Anyone knowing this please help me...
- (void)viewWillAppearBOOL)animated {
[super viewWillAppear:YES];
self.title = [self.keyOfTheFieldToEdit capitalizedString];
NSString* kk = self.keyOfTheFieldToEdit;
if(kk == @"firstName" || kk == @"lastName" || kk == @"email") {
CGRect frame = CGRectMake(20.0, 68.0, 280.0, 31.0);
UITextField *aTextField = [[UITextField alloc] initWithFrame:frame];
self.textField2 = aTextField;
[aTextField release];
textField2.textAlignment = UITextAlignmentCenter;
textField2.borderStyle = UITextBorderStyleRoundedRect;
textField2.autocapitalizationType = UITextAutocapitalizationTypeWords;
textField2.keyboardType = UIKeyboardTypeNamePhonePad;
textField2.returnKeyType = UIReturnKeyDone;
textField2.delegate = self;
[self.view addSubview:textField2];
textField2.text = self.editValue;
[textField2 becomeFirstResponder];
}
else if(kk == @"note") {
self.textField2.enabled = NO;
CGRect frame = CGRectMake(20.0, 60.0, 280.0, 120.0);
UITextView *aTextView = [[UITextView alloc] initWithFrame:frame];
self.textView = aTextView;
[aTextView release];
textView.backgroundColor = [UIColor whiteColor];
textView.keyboardType = UIKeyboardTypeNamePhonePad;
textView.returnKeyType = UIReturnKeyDone;
textView.delegate = self;
[self.view addSubview:textView];
textView.text = self.editValue;
[textView becomeFirstResponder];
}
here after calling my else if part, when we call if part both are displaying...
when we call else if part after if ,then it is overlapping, so in view there is no problem..
Asif