how to remove sub views.
Posted
by mac
on Stack Overflow
See other posts from Stack Overflow
or by mac
Published on 2010-06-09T11:57:54Z
Indexed on
2010/06/09
12:02 UTC
Read the original article
Hit count: 206
Hi
I have added UIButton,UITextView as subview to my view, programatically.
notesDescriptionView = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,460)]; notesDescriptionView.backgroundColor=[UIColor redColor]; [self.view addSubview:notesDescriptionView];
textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,320,420)]; [self.view addSubview:textView]; printf("\n description button \n");
button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchDown]; [button setTitle:@"OK" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, 420.0, 160.0, 40.0); [self.view addSubview:button];
here if we click the button , i need to remove the all the sub views,
i am trying [self.view removeFromSuperView] but its not working
any help.
© Stack Overflow or respective owner