2012-12-06 37 views
0

我想隱藏動畫的一些看法在我上點擊類似Grafio應用程序,如圖圖像下面隱藏動畫的看法。請給我一些方向來實現這一點。IOS:在點擊

enter image description here

回答

1

使第一兩個三角形狀的圖象最多方向,另一個用於下行方向說up.png和down.png

然後設置爲不同的控制狀態兩個圖像等....

[btn setBackgroundImage:[UIImage imageNamed:@"down.png"] forState:UIControlStateNormal]; 
[btn setBackgroundImage:[UIImage imageNamed:@"up.png"] forState:UIControlStateSelected]; 
現在

在該按鈕寫的IBAction ...

- (IBAction)onEnterQtySaveClick:(id)sender 
{ 
    UIButton *button = (UIButton *)sender; 

    if (button.selected) 
    { 
     // move up the menuView 
     [UIView animateWithDuration:0.3 animations:^{ 

      [self.menuView setFrame:CGRectMake(0, 0, 320, 50)]; 
     }]; 
    } 
    else 
    { 
     // move down the menuView 
     [UIView animateWithDuration:0.3 animations:^{ 

      [self.menuView setFrame:CGRectMake(0, 50, 320, 50)]; 
     }]; 
    } 

    button.selected = !button.selected; 
} 

希望你會喜歡這個,它會解決您還有更多的問題