我尝试在代码后添加带动画的SubView.没关系.
[self.view addSubview:pickerView];
pickerView.frame = CGRectMake(0, 0, 320, 50);
[UIView animateWithDuration:1.0
animations:^{
pickerView.frame = CGRectMake(0, 152, 320, 260);
}];
Run Code Online (Sandbox Code Playgroud)
我还想删除像上面动画一样的幻灯片动画的子视图.
我怎样才能做到这一点?
提前致谢.
您可以使用此animateWithDuration完成块来删除视图
[UIView animateWithDuration:1.0
animations:^{
pickerView.frame = //move it out of screen
} completion:^(BOOL finished) {
[pickerView removeFromSuperView];
}];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3621 次 |
| 最近记录: |