美文网首页
UIView 视图方法

UIView 视图方法

作者: hanyongwei | 来源:发表于2021-05-10 10:55 被阅读0次
    • (void)removeFromSuperview;将视图从父视图中移除

    • (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;插入一个视图到指定位置,视图越在下面,index越小

    • (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;将index1和index2位置的两个视图互换位置

    • (void)addSubview:(UIView *)view;添加视图到父视图

    • (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;插入视图到指定视图的下面

    • (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;插入视图到指定视图上面

    • (void)bringSubviewToFront:(UIView *)view;把视图移到最顶层

    • (void)sendSubviewToBack:(UIView *)view;把视图移到最底层

    • (UIView *)viewWithTag:(NSInteger)tag; 根据视图的tag属性找到搜索视图

    相关文章

      网友评论

          本文标题:UIView 视图方法

          本文链接:https://www.haomeiwen.com/subject/ssabdltx.html