Ios 单击UIView按钮,然后从上到下像下拉一样打开新的UIviewController

Ios 单击UIView按钮,然后从上到下像下拉一样打开新的UIviewController,ios,iphone,Ios,Iphone,你应该用下面的代码实现不同的导航风格,希望这对你有所帮助 (IBAction)btnClick:(id)sender { secondView *sc= [self.storyboard instantiateViewControllerWithIdentifier:@"secondView"]; [self.navigationController pushViewController:sc animated:YES]; } 快乐编码 对于视图动画: 对于从下到上的动画,请在

你应该用下面的代码实现不同的导航风格,希望这对你有所帮助

(IBAction)btnClick:(id)sender
{
    secondView *sc= [self.storyboard instantiateViewControllerWithIdentifier:@"secondView"];
    [self.navigationController pushViewController:sc animated:YES];
}
快乐编码

对于视图动画:

对于从下到上的动画,请在下方添加

UIViewController * secondView = [self.storyboard instantiateViewControllerWithIdentifier:@"secondView"];


CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade
//transition.subtype = kCATransitionFromTop; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom

[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:secondView animated:NO];
像这样试试看

[UIView animateWithDuration:0.5
                      delay:0.1
                    options: UIViewAnimationCurveEaseIn
                 animations:^{
                     self.postStatusView.frame = CGRectMake(0, 0, 320, 460);
                 } 
                 completion:^(BOOL finished){
                 }];
[self.view addSubview:self.postStatusView];

ase nai karna jab mai按钮每次单击karu选项卡查看自上而下aana chahiye类下拉菜单view@Birendra,请检查我的编辑答案。这是自下而上的。根据您的要求更改您的逻辑。嗨,这不工作,我必须这样看,如下拉或从上到下,当e按下按钮,我做了一些改变,感谢这是工作。。。。如果您正在使用skype,请给我您的skype id,以便我可以添加我的skype帐户
 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
DetailViewController *eventDetailsViewController = [storyboard instantiateViewControllerWithIdentifier:@"DetailViewController"];

eventDetailsViewController.view.frame= CGRectMake(0, -self.view.bounds.size.height, self.view.bounds.size.width, self.view.bounds.size.height);
eventDetailsViewController.view.backgroundColor = [UIColor redColor];

[UIView animateWithDuration:1.5 delay:0.f options:UIViewAnimationOptionCurveEaseInOut animations:^{
    [eventDetailsViewController.view setFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
} completion:^(BOOL finished){

}];

[self.view addSubview:eventDetailsViewController.view];
[self addChildViewController:eventDetailsViewController];