在其中一个 iPad 应用程序中,我正在向视图添加自定义视图。这工作正常,但现在我想删除所有添加的自定义视图。我怎么做?
以下是我添加自定义视图的代码
for (int col=0; col<colsInRow; col++) {
// NSLog(@"Column Number is%d",col);
x=gapMargin+col*width+gapH*col;
//self.styleButton=[[UIButton alloc] initWithFrame:CGRectMake(x, y, width, height)];
ComponentCustomView *componentCustomobject=[[ComponentCustomView alloc] initWithFrame:CGRectMake(x, y, width, height)];
componentCustomobject.backgroundColor=[UIColor redColor];
componentCustomobject.componentLabel.text=[appDelegate.componentsArray objectAtIndex:row];
[self.formConatinerView addSubview:componentCustomobject];
tempCount1++;
}