如何将UIView隐藏和显示(动画)为UIActionSheet?

3 iphone cocoa-touch objective-c ios

我是iOS开发的新手,请关注我的问题.

正如我的标题所说,

我如何隐藏和显示UIView(使用动画)UIActionSheet
在谷歌搜索,芽没有找到有效的解决方案..

注意: 我发现以下行,但它没有帮助我.

Suk*_*ngh 7

请尝试以下代码:

- (IBAction)showTapped:(id)sender {
    hideButton.enabled=YES;
    showButton.enabled=NO;
    [UIView animateWithDuration:.5 animations:^{
        subView.frame=CGRectMake(0, 225, subView.frame.size.width, subView.frame.size.height);
    }];
}

- (IBAction)hideTapped:(id)sender {
    hideButton.enabled=NO;
    showButton.enabled=YES;
    [UIView animateWithDuration:.5 animations:^{
        subView.frame=CGRectMake(0, 480, subView.frame.size.width, subView.frame.size.height);
    }];
}
Run Code Online (Sandbox Code Playgroud)