首页 > 代码库 > 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常见方法的补充
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。