ios 怎么让一个view的动画效果

2025-04-18 20:20:40
推荐回答(1个)
回答1:

首先设置一个VIEW初始位置在屏幕下, 比如iPhone6:CGRectMake(0, 667, 375, 667);
然后在一个方法中(比如button出发的方法)view添加动画
[UIView animateWithDuration:0.5 animations:^{

// 设置view弹出来的位置

self.myView.frame = CGRectMake(40, 100, 200, 250);

}];