我以编程方式创建了UIView。现在我想用动画显示视图。我的代码在下面。请注意,代码位于按钮单击事件上。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];
您应该指定“动画”的含义。你想要什么动画? –
我的意思是,当我点击按钮视图是通过适当的动画显示不正常 – Nasir
有大量的动画可能,你应该真正澄清你想要什么。 –