swift学习笔记之QQ简写
Qq项目学习 键盘设置点击屏幕后返回 self.messageInputTextField.resignFirstResponder() 需要添加UITextfield的代理 tableview 注册cell tableViewMessInfo.registerClass(UITableViewCell.self,forCellReuseIdentifier: "cell") tableViewMessInfo.dataSource = self tableViewMessInfo.delegate = self tableViewMessInfo.frame = CGRectMake(0,64,self.view.frame.width,self.view.frame.height - 94) tableViewMessInfo.separatorColor = UIColor.clearColor() //设置背景颜色 tableViewMessInfo.backgroundColor = UIColor.clearColor() self.view.addSubview(tableViewMessInfo) cell.selectionStyle = .None //设置cell的点击风格 点击UITextField被键盘遮住 func textFieldDidBeginEditing(textField: UITextField) { println("开始输入") var frame = self.view.frame frame.origin.y = -260 self.view.frame = frame
} //界面上移动260像素 界面跳转 self.dismissViewControllerAnimated(true,completion: nil) self.presentViewController(HomeViewController(),animated: true,completion: nil) tableview重新加载数据 self.tableViewMessInfo.reloadData() 设置导航栏 var navigationItems = UINavigationItem() var navigationBar = UINavigationBar() navigationItems.leftBarButtonItem = UIBarButtonItem(title: "返回",style: .Plain,target: self,action: "cancle") navigationItems.rightBarButtonItem = UIBarButtonItem(title: "关于联系人",action: "about") navigationItems.title = "聊天" navigationBar.tintColor = UIColor.blueColor() navigationBar.frame = CGRectMake(0,0,64) navigationBar.pushNavigationItem(navigationItems,animated: true) self.view.addSubview(navigationBar) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- JSONObject、JSONArray结合Map的使用案例
- c# – MVC 5 ViewModel不像在MVC 4中那样工作
- oracle 查看调度作业和job的表
- 如何在Xcode中的模拟器构建中排除框架
- u-boot-2014.10移植第28天----nand flash启动(六
- 简单大方的登陆界面(包括flash动画)
- reactjs – 从React元素获取HTML标记名称?
- Swift入门(四)——可选类型(Optionals)与断言
- [每日一题] OCP1z0-047 :2013-08-21 ? 正则表达式
- A FLASH Bootloader for PIC16 and PIC18 Device