iOS 10 Message Extension应用程序:如何获取此功能创建的MSSticker? [英] iOS 10 Message Extension app: How can I get the MSSticker created by this function?
本文介绍了iOS 10 Message Extension应用程序:如何获取此功能创建的MSSticker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在github上找到了这个仓库,使您可以从图像创建动画MSSticker:
I found this repo on github that enables you to create an animated MSSticker from images:
https://github.com/radif/MSSticker-Images
一旦我打电话给我
let sticker = MSSticker(images: images, frameDelay: 1.0/14.0, numberOfLoops: 0, localizedDescription: "generated sticker")
如何使标签显示在视图或文本栏中?我无法将其添加为视图的子视图,那么如何显示它?
How do I make the sticker appear in the view or the text bar? I can't add it as a subview to my view, so how do I show it?
推荐答案
Looking at the GitHub link you provided it seems like a look at the Apple Documentation about MSSticker should help. And if I am not mistaken that GitHub repo is just helping you create an MSSticker from an array of UIImages. Try this out:
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)
这篇关于iOS 10 Message Extension应用程序:如何获取此功能创建的MSSticker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文