这是一个点击弹出动态菜单效果,源码SphereMenuSwift,SphereMenuSwift使用 UIDynamicAnimator做的动态菜单。点击按钮弹出菜单。菜单可以拖拽。模拟碰撞物理效果,这是用Swift写的项目。
效果图:
- <ignore_js_op>class="zoom" src="/Upload/Images/2014111912/8F806DB20E5CE1A4.gif" alt="" width="318" />
使用方法:
代码的实现:
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
self.view.backgroundColor = UIColor(red:0.2, green:0.38, blue:0.8, alpha:1)
let start = UIImage(named: "start")
let image1 = UIImage(named: "icon-twitter")
let image2 = UIImage(named: "icon-email")
let image3 = UIImage(named: "icon-facebook")
var images:[UIImage] = [image1!,image2!,image3!]
var menu = SphereMenu(startPoint: CGPointMake(160, 320), startImage: start!, submenuImages:images)
menu.delegate = self
self.view.addSubview(menu)
}
详细说明:http://ios.662p.com/thread-2241-1-1.html