首页 > 代码库 > UIView常见方法的补充

UIView常见方法的补充

UIView常见方法的补充

 1 //1.从父控件中移除
 2 - (void)removeFromSuperview;
 3 
 4 //2.根据一个tag标识找出对应的控件(一般都是子控件)
 5 - (UIView *)viewWithTag:(NSInteger)tag;
 6 
 7 //3.将子控件view插入到subviews数组的index位置
 8 - (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;
 9 
10 //4.将子控件view显示到子控件siblingSubview的下面
11 - (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;
12 
13 //5.将子控件view显示到子控件siblingSubview的上面
14 - (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;
15 
16 //6.将子空间view放到数组的最后面,显示在视图的最上面
17 - (void)bringSubviewToFront:(UIView *)view;
18 
19 //7.将子控件view放到数组的最前面,显示在视图的最下面
20 - (void)sendSubviewToBack:(UIView *)view;
21 
22 //8.将超出父控件边界的东西都裁减掉,默认值为NO
23 self.view.clipsToBounds = YES;

 

UIView常见方法的补充