我有5X5個按鈕網格。如果我按下位置1上的按鈕然後按下位置2上的按鈕,我希望位置1的按鈕圖像移動到位置2上的按鈕。如下面的示例所示,先按A1按鈕,然後按下B2按鈕。
實施例:
將按鈕圖像從第一個按鈕按下移至按下的第二個按鈕
圖:A1按鈕按下
圖:B2按鈕按下
所以,總過程有兩個步驟:
1. Prepare to move image when first button pressed
2. Move the image from first button to second button when the second button is pressed
我已經設置了5X5網格中顯示的那25個按鈕的按鈕標籤。現在我無法找到理想的行動邏輯。
什麼是在這些方法的邏輯:
-(void)a1ButtonPressed:(id)sender
{
}
-(void)b2ButtonPressed:(id)sender
{
}
雖然按鈕具有這些標記:
A1.tag = 1;
B2.tag = 7;
誰能幫助?在此先感謝.... :)
這是好事,但使用這些方法中的iOS 4和更高氣餒。改爲使用基於塊的動畫方法。 – Beppe 2012-04-09 11:29:03