Animate UIImageView从圆角右上角开始并以Rectangle结尾

时间:2019-05-14 07:51:58

标签: ios swift uiview uiviewanimation uiviewpropertyanimator

我正在为const httpOptions = { headers: new HttpHeaders({ 'Content-Type' : 'application/json', 'Accept' : 'application/json' }) }; //pass your params here let params = new HttpParams().set("paramName",paramValue).set("paramName2", paramValue2); return this.http.get(url, {headers: httpOptions, params: params}); 制作动画,该动画应该从小圈子显示

赞: enter image description here

开始大小

ImageView

y = startFrame.origin.y + startFrame.size.height - 10

仅右上一轮

EndFrame

原始矩形

  

ImageView内容不应收缩或扩展,其内容应为   就像上面的屏幕截图一样。

是否可以在iOS中完成?

1 个答案:

答案 0 :(得分:2)

在此处查看此解决方案,它可在iOS 11及更高版本上运行

if #available(iOS 11, *) {

        roundedView.layer.maskedCorners = [.layerMaxXMinYCorner]
        self.roundedView.layer.cornerRadius = 20

        UIView.animate(withDuration: 2, animations: {
            self.roundedView.layer.cornerRadius = 0
        }, completion: nil )

    }

这里也是参考: https://useyourloaf.com/blog/masked-and-animated-corners/