【发布时间】:2013-07-24 11:26:37
【问题描述】:
我以编程方式创建了一个 UIView。现在我想用动画显示视图。我的代码如下。请注意,代码是在按钮单击事件上。
view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 284)];
view1.backgroundColor = [UIColor redColor];
[self.view addSubview: view1];
UIButton *cancel = [UIButton buttonWithType:UIButtonTypeRoundedRect];
cancel.frame = CGRectMake(265, 0, 55, 20);
[cancel setTitle: @"Cancel" forState: UIControlStateNormal];
[cancel addTarget:self action:@selector(cancelView:) forControlEvents:UIControlEventTouchUpInside];
【问题讨论】:
-
您应该指定“动画”的含义。你想要什么动画?
-
我的意思是当我点击按钮时,视图通过不正常的适当动画显示
-
有很多动画可能,你应该明确你想要什么。
-
我还没有应用任何动画。所以我不知道。
-
raywenderlich.com/2454/how-to-use-uiview-animation-tutorial UIView 动画基础教程。