How to hide keyboard when you click backgroud in a TTTableView?
2012-02-15 14:05
465 查看
1. set tableview delegate with yourself(TTTableViewController<TTTableViewDelegate>).
self.tableView.delegate = self;
2. implement touchesBegan
- (void)tableView:(UITableView*)tableView touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
NSLog(@"touchesBegan");
[yourTextField resignFirstResponder];//or any control need to hide keyboard
}
self.tableView.delegate = self;
2. implement touchesBegan
- (void)tableView:(UITableView*)tableView touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
NSLog(@"touchesBegan");
[yourTextField resignFirstResponder];//or any control need to hide keyboard
}
相关文章推荐
- How to cal Session_End() method when you store the Session state not in Inprc but StageServer, etc.
- [转]How to hide inputAccessoryView without dismissing keyboard
- How to find indexPath for tapped button in tableView Using Seque
- TIP: when you get a message in job log user [Dr. Who] is not authorized to view the log
- How to view the schema class or attribute definition you first have to install the Active Directory Schema snap-in
- How to reclaim space in InnoDB when innodb_file_per_table is ON
- How to invoke the method of managed bean and render view in JSF when we are outside the lifecycle of JSF
- In C how do you redirect stdin/stdout/stderr to files when making an execvp() or similar call?
- Code view is missing in SharePoint Designer Beta 2 when you try to edit a WSS v3 site.
- how to javafx hide background header of a tableview?
- How to hide keyboard in Swift
- How To Add Search Bar in Table View
- How to hide the create button dynamical tree view in openerp ?
- How to let FIR open a URL when you click an image
- Error message when you try to save a table in SQL Server 2008: "Saving changes is not permitted"
- In an iOS 5 Storyboard, how do you push a new scene to the original view controller from a Popover?
- How To Determine Table/View Name in a Form
- Cannot insert explicit value for identity column in table 'settings' when IDENTITY_INSERT is set to OFF.
- 【Android笔记】引用第三方自定义控件出错:Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
- How To Make a Custom UIView in iOS 5: A 5 Star Rating View[转]