zoukankan      html  css  js  c++  java
  • UISearchBar的使用

    1. searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake(0.0, 0.0, self.view.bounds.size.width, 40)];  
    2.     searchBar.placeholder=@"Enter Name";  
    3.     searchBar.delegate = self;  
    4.     searchBar.showsCancelButton = YES;  
    5.     theTableView.tableHeaderView = searchBar;  
    6.     searchBar.keyboardType = UIKeyboardTypeDefault;  
    7.     //searchBar.autocorrectionType = UITextAutocorrectionTypeNo;  
    8.     //searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;  
    9.       
    10.     [self.view addSubview: searchBar];  
    11.   
    12. //search Button clicked....  
    13. - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar                     // called when keyboard search button pressed  
    14. {  
    15.     NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );  
    16.     [searchBar resignFirstResponder];  
    17. }  
    18. //cancel button clicked...  
    19. - (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar                    // called when cancel button pressed  
    20. {  
    21.     NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );  
    22.       
    23.     [searchBar resignFirstResponder];  
    24.       
    25. }  
  • 相关阅读:
    第1章:程序设计和C语言(C语言入门)
    倒计时IE6+
    uploadify 使用 详细 说明
    HTTP 错误
    asp.net 向后台提交 html 代码段 包括 <> 标签
    C#使用NLog记录日志
    IE浏览器 location.href 不跳转
    .Net Core 导出Excel
    .net mvc 获取acion 返回类型
    sql sever 执行较大的文件脚本
  • 原文地址:https://www.cnblogs.com/yulang314/p/3790439.html
Copyright © 2011-2022 走看看