2

我正在尝试为ImageView 应该从小圆圈中出现的动画制作动画

像这样: 在此处输入图像描述

起始尺寸

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

height = 10 , width = 10

仅限右上角

结束帧

原来的长方形

ImageView 内容不应该缩小或扩大,它的内容应该像上面的截图一样出现。

有可能在iOS中做吗?

4

1 回答 1

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/

于 2019-05-14T08:21:03.437 回答