像Mac OS内核恐慌的UIview动画

tim*_*imy 0 iphone animation objective-c uiview

当Mac内核恐慌,有动画,它不完全像幻灯片动画,如何在iPhone中实现这个动画,是否存在这样做的API?

sha*_*oga 5

没有API,但它是相当简单的动画:只需创建一个UIView动画frame,然后从0高度变为全高:

   // Create your view
   UIView *kPview = [[UIView alloc] init];
   // Add it to your view
   [self.view addSubView:kPview]
   // Set its frame
   kPview.frame = CGRectMake(0,0,320,0);

   //Set the animation
   [UIView animateWithDuration:5 
                 animations:^{
                     kPview.frame = CGRectMake(0,0,320,460);
                 }
                 completion:^(BOOL finished){
                     //add a UILabel with the warning.
                 }];
Run Code Online (Sandbox Code Playgroud)