當點擊一個按鈕時,我顯示一個UIView
並且它動畫並向上滑動。如何用動畫關閉UIView
現在,當我點擊按鈕時,方法buttoncall
被調用。 我想用動畫關閉(向下/關閉)視圖。 我該怎麼做?
v = [[MyView alloc] initWithFrame:mycell.bounds];
[v.flipLowButton addTarget:self action:@selector(buttoncall:) forControlEvents:UIControlEventTouchUpInside];
[mycell addSubview:v];
CGRect r=v.frame;
r.origin.y= mycell.frame.size.height;
v.frame=r;
rect.origin.y=r.origin.y-r.size.height;
[UIView animateWithDuration:.2 animations:^{
v.frame=r; }];
- (void) buttoncall:(UIButton *)sender {
// How to bring down the menu.
}
只是做相反的,你做了什麼來顯示菜單。 – rmaddy 2015-03-25 04:00:18