<span style="font-family:Verdana;">// // 获取当前控制器所管理的view下的所有子控件
//
// // subviews表示获取某个控件的所有子控件
// for (UIView *View in self.view.subviews){
// View.backgroundColor = [UIColor redColor];
// }
// self.txt1.superview.backgroundColor = [UIColor yellowColor];
// //根据tag来获取某个控件
// UITextField *txt = (UITextField*)[self.view viewWithTag :1000];
//
// txt.text = @"年";
//从子控件从父控件中移除
while (self.view.subviews.firstObject) {
[self.view.subviews.firstObject removeFromSuperview];
}
</span>