UIView层的操作(简单总结,备用)

来源:互联网 发布:win10系统无法下载软件 编辑:程序博客网 时间:2024/05/04 20:14
//从主view删除- (void)removeFromSuperview;//插入到指定索引位置- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;//交换两view的索引位置- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;//加到view上- (void)addSubview:(UIView *)view;//插入到siblingSubview下层- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;//插入到siblingSubview下层- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;- (void)bringSubviewToFront:(UIView *)view;- (void)sendSubviewToBack:(UIView *)view;- (void)didAddSubview:(UIView *)subview;- (void)willRemoveSubview:(UIView *)subview;- (void)willMoveToSuperview:(UIView *)newSuperview;- (void)didMoveToSuperview;- (void)willMoveToWindow:(UIWindow *)newWindow;- (void)didMoveToWindow;- (BOOL)isDescendantOfView:(UIView *)view; // returns YES for self.- (UIView *)viewWithTag:(NSInteger)tag; // recursive search. includes self 通过tag值找到某个view
0 0
原创粉丝点击