我有2个按钮,后加入的那个总在先加入的那个上面,但是我想让他在下面不要遮挡按钮1,如何解决?谢谢

解决方案 »

  1.   

    - (void)bringSubviewToFront:(UIView *)view;
    - (void)sendSubviewToBack:(UIView *)view;
      

  2.   

    用鼠标把视图对应的列表拖到下面。
    如:显示view,
              label1,
              label2.
    要想让label1在上层,把label1拖到label2下面就可以了。(昨天在狮子系统中试过)。
      

  3.   

    - (void)bringSubviewToFront:(UIView *)view;
    - (void)sendSubviewToBack:(UIView *)view;
      

  4.   

    直接将按钮2 拖到view的试图上,就不会覆盖了
      

  5.   

    更复杂的改变view层次的方法:- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;
    - (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;
    - (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;