大佬教程收集整理的这篇文章主要介绍了ios – 将图像添加到UIAlertController,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
var alertController = UIAlertController(title: "How to Skate",message: "Tap the screen to perform a trick and jump over the obsticles (You can grind on rails) The game will end when you hit a highlighted red,orange or yellow obstacle. That's it! + Image",preferredStyle: UIAlertControllerStyle.Alert) alertController.addAction(UIAlertAction(title: "Cool!",style: UIAlertActionStyle.Cancel,handler: nil)) self.view?.window?.rootViewController?.presentViewController(alertController,animated: true,completion: nil)
var imageView = UIImageView(frame: CGRectMake(220,10,40,40)) imageView.image = yourImage alert.view.addSubview(imageView)
这是你在UIAlertController中的表现:
let alertmessage = UIAlertController(title: "My title",message: "My message",preferredStyle: .Alert) let image = UIImage(named: "myImage") var action = UIAlertAction(title: "OK",style: .Default,handler: nil) action.SETVALue(image,forKey: "image") alertmessage .addAction(action) self.presentViewController(alertmessage,completion: nil)
以上是大佬教程为你收集整理的ios – 将图像添加到UIAlertController全部内容,希望文章能够帮你解决ios – 将图像添加到UIAlertController所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。