您的位置:首页 > 移动开发 > Swift

UIWebView读取Gif图 swift

2016-09-29 15:18 417 查看
 let file =
NSBundle.mainBundle().pathForResource("voicegif",
ofType: "gif")

        

        if file !=
nil {

            

            

            let fileUrl =
NSURL.fileURLWithPath(file!)

            

            let data =
NSData(contentsOfFile: file!)

            

            voiceWebView.loadData(data!, MIMEType:
"image/gif", textEncodingName:
"utf-8", baseURL: fileUrl)

            

            

        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息