I am creating textField in UIActionsheet, but I can't input text, can any one has idea about it ????
my coding is as follow
-(void)commentsMethod: (id) sender {
//setup UITextField for the UIActionSheet
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 28, 320, 150)];
//textField.delegate=self;
textField.autocorrectionType = UITextAutocorrectionTypeNo;
[textField setBackgroundColor:[UIColor clearColor]];
[textField setBorderStyle:UITextBorderStyleRoundedRect];
[textField becomeFirstResponder];
//CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>)
UIButton *btn = [[UIButton alloc] init];
[btn setFrame:CGRectMake(0, 0, 100, 100)];
[btn setTitle:@"dismiss" forState:UIControlStateNormal];
[btn setBackgroundColor:[UIColor clearColor]];
[btn addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
UIActionSheet *myActionSheet;
myActionSheet = [[UIActionSheet alloc] initWithTitle:@"Comments" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil, nil];
myActionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[myActionSheet showInView:self.view];
myActionSheet.userInteractionEnabled=YES;
[myActionSheet setFrame:CGRectMake(0, 20, 320,600)];
[myActionSheet insertSubview:textField atIndex:0];
[myActionSheet insertSubview:btn atIndex:1];
//[self.myActionSheet dismissWithClickedButtonIndex:0 animated:NO];
//memory management
[textField release];
[myActionSheet release];
}