【发布时间】:2011-01-21 04:46:29
【问题描述】:
我有主 UIView,我在其中显示不同的数据。然后我放了一个按钮,它显示这样的子视图:
- (IBAction) buttonClicked:(id)sender
{
UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(25,25,50,20)];
UILabel *newLabel = [[UILabel alloc] initWithFrame:CGRectMake(25,25,50,25)];
newLabel.text = @"some text";
[newView addSubview:newLabel];
[self.view addSubview:newView];
[newLabel release];
[newView release];
}
newView 看起来不错,但它不会以任何方式为自己设置动画,它只是立即出现。 newView 出现时如何添加某种动画?像缩放或向下滑动或类似的东西。有一些简单的代码吗?
【问题讨论】: