码迷,mamicode.com
首页 > 其他好文 > 详细

简单自定义UIToolBar

时间:2015-12-09 17:22:51      阅读:296      评论:0      收藏:0      [点我收藏+]

标签:

 let item1 = UIBarButtonItem(title: "分享", style: .Plain, target: self, action: nil)
        let item2 = UIBarButtonItem(barButtonSystemItem: .Pause, target: self, action: nil)
        let item3 = UIBarButtonItem(image: UIImage(named: "main_badge@3x"), style: .Plain, target: self, action: nil)
        
        // 弹簧
        let space = UIBarButtonItem(barButtonSystemItem: .FlexibleSpace, target: self, action: nil)
        
        let customToolBar = UIToolbar(frame: CGRectMake(0,300,self.view.frame.size.width,44))
        
        customToolBar.setItems([item1,space,item2,space,item3], animated: true)
        
        self.view.addSubview(customToolBar)

 

简单自定义UIToolBar

标签:

原文地址:http://www.cnblogs.com/Iceing/p/5033190.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!