像Mac OS内核恐慌的UIview动画

时间:2012-01-09 14:42:08

标签: iphone objective-c animation uiview

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

1 个答案:

答案 0 :(得分: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.
                 }];