【发布时间】:2010-07-28 20:07:21
【问题描述】:
我希望 UIView 像 UIActionSheet 一样从屏幕底部向上滑动(并保持在屏幕中间)。我怎样才能做到这一点?
更新: 我正在使用以下代码:
TestView* test = [[TestView alloc] initWithNibName:@"TestView" bundle:nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.4];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
test.view.center = CGPointMake(160,100);
//test.view.frame = CGRectMake(0, 0, 160, 210);
[[[UIApplication sharedApplication] keyWindow] addSubview:test.view];
[UIView commitAnimations];
视图似乎是从角落动画并出现在角落里。我怎样才能让它从底部向上滑动?接近了!
【问题讨论】:
-
更新的帖子包含一些应该有帮助的代码
标签: iphone objective-c cocoa-touch uiview core-animation