我在 github 上找到了这个 repo,它使您能够从图像创建动画 MSSticker:
https://github.com/radif/MSSticker-Images
一旦我调用:
let sticker = MSSticker(images: images, frameDelay: 1.0/14.0, numberOfLoops: 0, localizedDescription: "generated sticker")
如何让标 checkout 现在 View 或文本栏中?我无法将它作为 subview 添加到我的 View 中,那么我该如何显示它呢?
最佳答案
查看您提供的 GitHub 链接似乎是在查看 Apple Documentation about MSSticker应该有帮助。如果我没记错的话,GitHub 存储库只是帮助您从一组 UIImages 创建一个 MSSticker。试试这个:
let yourSticker = MSSticker(images: images, frameDelay: 1.0/14.0, numberOfLoops: 0, localizedDescription: "generated sticker")
// stickerView is an MSStickerView, which inherits from UIView
let stickerView = init(CGRect(...), sticker: yourSticker)
yourView.addSubview(stickerView)
关于swift - iOS 10 消息扩展应用程序 : How can I get the MSSticker created by this function?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39094981/