【发布时间】:2015-04-27 02:56:05
【问题描述】:
我想像这样在 UIView 的上边框内弯曲,
我尝试了很多方法,比如 UIBezierPath 等。
需要帮助。
【问题讨论】:
-
再次尝试 UIBezierPath ;)
-
如果 UIBezierPath 不能帮助创建类似上述曲线的图像并将其设置为视图的背景。
-
@Kampai:实际上我正在使用 CAShapeLayer。有多个层,所以我正在寻找一些 UIBezierPath 解决方案。
-
好吧,我想通了。动画整个视图。在动画期间,将 self.view.origin.y 更改为下方。现在完成设置 self.view.origin.y 到它的原始位置。 NSInteger 选项 = UIViewAnimationCurveEaseInOut; orgRect = self.frame; CGRect tempRect = orgRect; tempRect.origin.y = tempRect.origin.y+20; [UIView animateWithDuration:0.05 delay:0.0 usingSpringWithDamping:0.5 initialSpringVelocity:0.5 options:option animations:^{ self.frame = tempRect; } 完成:^(布尔标志){ self.frame = orgRect; }];
标签: ios objective-c xcode cocoa-touch core-animation