1
我正在嘗試使按下時增長的UIButton。目前,我有我的按鈕的按下事件下面的代碼(的Tim's answer提供):按下UIButton時移動
#define button_grow_amount 1.2
CGRect currentFrame = button.frame;
CGRect newFrame = CGRectMake(currentFrame.origin.x - currentFrame.size.width/button_grow_amount,
currentFrame.origin.y - currentFrame.size.height/button_grow_amount,
currentFrame.size.width * button_grow_amount,
currentFrame.size.height * button_grow_amount);
button.frame = newFrame;
運行然而,當這使得我的按鈕,向上移動,向左每次它按下時。有任何想法嗎?
這個工作!謝謝! – RCIX 2009-07-13 23:40:20