UIView的常见属性

@property(nonatomic,readonly) UIView *superview;
获得自己的父控件对象
 
@property(nonatomic,readonly,copy) NSArray *subviews;
获得自己的所有子控件对象
 
@property(nonatomic) NSInteger tag;
控件的ID标识,父控件可以通过tag来找到对应的子控件
 
@property(nonatomic) CGAffineTransform transform;
控件的形变属性(可以设置旋转角度、比例缩放、平移等属性)
 
@property(nonatomic) CGRect frame;
控件所在矩形框在父控件中的位置和尺寸(以父控件的左上角为坐标原点)
 
@property(nonatomic) CGRect bounds;
控件所在矩形框的位置和尺寸(以自己左上角为坐标原点,所以bounds的xy一般为0)
 
@property(nonatomic) CGPoint center;
控件中点的位置(以父控件的左上角为坐标原点)
 
  SecondViewController *second=[self.storyboard instantiateViewControllerWithIdentifier:@"two"]; 在故事板中的storyboardid设置标识 然后采用在stroyboard中查找
 
[self.two.view removeFromSuperview] 移除该视图 视图并不一定销毁得看引用
[self.view addSubview:self.two.view] 如果当前是这个视图不会重复添加
原文地址:https://www.cnblogs.com/Opaser/p/4595166.html