1、 设置圆角
//设置圆角 func setRadius(item:UIView,radius:CGFloat){ item.layer.cornerRadius=radius item.layer.masksToBounds=true }
例如:<p style="margin-top: 0px; margin-bottom: 0px; font-size: 11px; font-family: Menlo;"><span style="color: rgb(147, 200, 106);"> </span><span style="color:#333333;"> setRadius(headerImgOne,radius: headerImgOne.frame.width/2)</span></p>2、设置阴影
<pre name="code" class="plain"> //设置背景阴影 panelView.layer.backgroundColor=UIColor.whiteColor().CGColor panelView.layer.shadowColor=UIColor.blackColor().CGColor panelView.layer.shadowOffset=CGSizeMake(0,0) panelView.layer.shadowOpacity=0.2 panelView.layer.shadowRadius=4
3、View 代码切换
let mainStoryboard=UIStoryboard(name:"Main",bundle:NSBundle.mainBundle()) let mainCenterViewController=mainStoryboard.instantiateViewControllerWithIdentifier("MainCenterViewController") as UIViewController self.presentViewController(mainCenterViewController,animated: true,completion: nil)4、使用 xib
新建Controller 选择 Also create XIB file 保存 就会发现有 xx.xib文件产生,controller 中使用
//实例化一个信息界面 let controller = InfoViewController(nibName:"InfoViewController", bundle:nil) //信息界面出现的动画方式 controller.modalTransitionStyle = UIModalTransitionStyle.CoverVertical //界面跳转 self.presentViewController(controller, animated:true, completion:nil)