1

我有两个UIButtons在一个ViewController。其中之一是可使用UIPanGesture识别器拖动的。我想把这个可拖动UIButton的放在一个固定的UIButton. 我怎样才能做到这一点?

这是我尝试过的:

if (CGRectIntersectsRect(self.firstButton.frame, self.oneButton.frame))
{    
    [self.oneButton addSubview:self.firstButton];    //first button is the dragable button.
}

但是我认为只是添加为子视图是行不通的。实现这一目标的正确方法是什么?

4

0 回答 0