斯坦福Developing iOS 8 Apps学习笔记(六)
来源:互联网 发布:医生都善良知乎 编辑:程序博客网 时间:2024/05/21 09:30
UITextField
一些基本属性
- becomeFirstResponder
- resignFirstResponder
- Return Key被按下时
func textFieldShouldReturn(sender:UITextField) -> Bool
一般需要sender.resignFirstResponder - textField resin firstResponder时
func textFieldDidEndEditing(sender:UITextField)
- clearOnBeginEditing:Bool
- adjustsFontSizeToFitWidth
- minimumFontSize(一般如果使用上面一个,则要设置这个)
- placeholder
- background/disabledBackground
- defaultTextAttributes //apply to entire text
- **UITextField在左右各有一个overlays,you can control in detail the layout of the text field(border, left/right view, clear button)
- var inputAccessoryView:UIView //UITextField method,加强键盘,能够在键盘上方创建一个view
对于输入的一些设置
由UITextField遵守UITextInputTraitsPropotocol
- var UITextAutoCapitalizationType // words,sentences,etc.
- var UITextAutoCorrectionType // yes or no
- var UIReturnKeyType // Go,Search,Google,Done…
- var Bool secureTextEntry
- var UIKeyboardType //ASCII,URL,PhonePad,etc.
键盘输入的可以监听的时事件
- UIKeyboard{will,did}{show,hide}Notifications sent by UIWindow
- 监听方法:
NSNotificationCenter.defaultCenter().addObserver(self, selector:"theKeyboardAppeared:", name:UIKeyboardDidShowNotification, object:view.window)
- notification.userInfo have the details about appearance
- 一般需要在此时控制使要输入的目标能够显示在键盘的上方
- UITableViewController listens for this and scrolls automatically
Table View
一些基本属性
- var tableHeaderView:UIView
- var tableFooterView:UIView
UITableViewDataSource
- tableView(UITableView, titleForHeaderInSection:Int)
- tableView(UITableView, titleForFooterInSection:Int)
- tableView(UITableView, cellForRowAtIndexPath:NSIndexPath)
dataSource主要是显示什么,Delegate主要是怎么显示
UITableViewDelegate
- tableView didselectRowAtIndexPath
- tableView accessoryButtonTappedForRowWithIndexPath
- will/did Select
- view For Header/Footer
- will begin/did end notifications for editing
tableView
- readloadData()
- reloadRowsAtIndexPaths
height of rows
- Row height can be fixed (rowHeight:CGFloat)
- rowHeight = UITableViewAutomaticDimension // uses AutoLayout
- help tableView by setting estimatedRowHeight
- tableView heightForRowAtIndexPath -> CGFloat //这个会被调用a lot
- tableView estimatedHeightForRowAtIndexPath -> CGFloat
tableView.estimatedRowHeight = tableView.rowHeighttableView.rowHeight = UITableViewAutomaticDimension
0 0
- 斯坦福Developing iOS 8 Apps学习笔记(六)
- 斯坦福Developing iOS 8 Apps学习笔记(一)
- 斯坦福Developing iOS 8 Apps学习笔记(二)
- 斯坦福Developing iOS 8 Apps学习笔记(三)
- 斯坦福Developing iOS 8 Apps学习笔记(四)
- 斯坦福Developing iOS 8 Apps学习笔记(五)
- 斯坦福Developing iOS 8 Apps学习笔记(七)
- Developing iOS 8 Apps with Swift 学习笔记
- 《Start Developing iOS Apps Today》学习笔记(三)心得体会
- Start Developing iOS Apps (Swift) 学习笔记 (1)
- Start Developing iOS Apps (Swift) 学习笔记 (2)
- 《Start Developing iOS Apps Today》学习笔记(一)部分翻译
- 《Start Developing iOS Apps Today》学习笔记(二)应用实现过程
- Developing iOS 8 Apps with Swift Lesson 11学习
- 斯坦福机器学习笔记六
- Start Developing iOS Apps Today
- Start Developing iOS Apps Today
- Start Developing iOS Apps Today
- (4.3.1.16)java.lang.NoSuchMethodException: setHomeActionContentDescription
- 写给自己——卡方检测
- 5、支持向量机SVM
- http://write.blog.csdn.net/postedit
- android 开发环境下载地址
- 斯坦福Developing iOS 8 Apps学习笔记(六)
- 新一代 Linux 文件系统 btrfs 简介
- Connecting to the Controller(与控制器对象连接)
- 黑马程序员——C语言基础语法
- java nio
- 双向链表的学习
- VEX Types(数据类型)
- 项目3 - 体验复杂度-汉诺塔
- assets和res/raw的区别