首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏大宇笔记

    导航栏搜索框简单封装

    navigationBar.addSubview(bar) } } } // MARK: UISearchBarDelegate extension NavigationSearchItemHelper : UISearchBarDelegate { func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {

    1.6K20发布于 2019-10-25
  • 来自专栏iOS开发笔记

    iOS开发-搜索栏UISearchBar和UISearchController

    为了实现搜索需要声明委托 UISearchBarDelegate , UISearchDisplayDelegate,其中搜索主要使用的就是UISearchDisplayDelegate,具体代码实现过程 indexPath.row]]; } else{ [cell.textLabel setText:self.dataList[indexPath.row]]; } return cell;} UISearchBarDelegate UISearchResultsUpdating: @interface ViewController : UITableViewController<UITableViewDelegate,UITableViewDataSource,UISearchBarDelegate

    3K70发布于 2018-03-30
  • 来自专栏LinXunFeng的专栏

    iOS - Swift UISearchController仿微信搜索框

    imageLiteral(resourceName: "VoiceSearchStartBtn"), for: .bookmark, state: .normal) 监听语音按钮的点击 // MARK:- UISearchBarDelegate extension LXFContactViewController: UISearchBarDelegate { func searchBarBookmarkButtonClicked(_

    2.4K30发布于 2018-06-29
  • 来自专栏学海无涯

    iOS17适配指南之UIContentUnavailableView(二)

    school -> Bool in school.contains(text) } } } } // MARK: - UISearchBarDelegate extension ViewController: UISearchBarDelegate { // MARK: 点击搜索 func searchBarSearchButtonClicked

    84320编辑于 2023-07-25
  • 来自专栏云原生布道专栏

    【IOS开发基础系列】UISearch专题

    //.控件的委托,委托要遵从UISearchBarDelegate协议,默认是nil     bar.delegate = self; ③代理要试实现的协议方法 1).输入编辑事件处理 – searchBar setPlaceholder: @"搜索城市中文/拼音/字母"];     [_searchVC.searchBar setDelegate: self]; } 4.1.3 委托处理 4.1.3.1 UISearchBarDelegate 委托处理 #pragma mark - UISearchBarDelegate 委托处理 - (void) searchBarTextDidBeginEditing: (UISearchBar*)searchBar

    2.3K20编辑于 2023-10-16
  • 来自专栏代码小技巧分享分析

    UISearchBar 搜索框

    ///在 .h 写代理 <UITableViewDelegate,UITableViewDataSource,UISearchBarDelegate> ///结合UITableView 展示了UISearchBar

    2.1K30发布于 2021-10-29
  • 来自专栏Alice

    iOS开发实战之搜索控制器UISearchController使用

    .m文件中代码如下  添加搜索控制器的各种协议 <UISearchBarDelegate,UISearchResultsUpdating,UIAlertViewDelegate> 创建两个实例和数据源

    3.2K30发布于 2018-12-26
  • 来自专栏HelloWorld杰少

    手把手带你撸一个网易云音乐首页(三)

    self.setPositionAdjustment(offset, for: .search) } } 当我们点击顶部的搜索框时,页面需要跳转到真正的搜索页面,所以我们需要实现 UISearchBarDelegate 代理函数: extension DiscoveryViewController: UISearchBarDelegate { // 点击跳转 func searchBarShouldBeginEditing 这里就需要来实现 UISearchResultsUpdating 和 UISearchBarDelegate 这俩个代理了,通过 UISearchBar 获取到输入值,然后在提供的数据源中查找,并 reload } } extension MusicSearchViewController: UISearchBarDelegate{ func searchBar(_ searchBar: UISearchBar

    3.1K10编辑于 2022-08-04
  • 来自专栏進无尽的文章

    实践-小细节Ⅵ

    boldSystemFontOfSize:10] forKeyPath:@"_placeholderLabel.font"]; [self addSubview:searchBar]; #pragma mark - UISearchBarDelegate

    1.3K20发布于 2018-09-12
  • 来自专栏iOS开发~

    iOS_系统自带地图圆形区域选择范围

    interface ViewController () <CLLocationManagerDelegate, MKMapViewDelegate, WWWAnnotationViewDelegate, UISearchBarDelegate

    2.8K10编辑于 2022-07-20
领券