zoukankan      html  css  js  c++  java
  • UISearchDisplayController使用注意事项

    1、每个UIViewController都有一个searchDisplayController属性,用当前视图控制器初始化一个UISearchDisplayControlle

    r对象后,searchDisplayController就指向这个对象,所以不用将这个对像声明为属性或者全局变量了,直接用self.searchDisplayController就可以了。

    1、每个UIViewController都有一个searchDisplayController属性,用当前视图控制器初始化一个UISearchDisplayController对象后,searchDisplayController就指向这个对象,所以不用将这个对像声明为属性或者全局变量了,直接用self.searchDisplayController就可以了。


    2、UISearchDisplayController的取消按钮的标题默认是英文的,若果想改变标题,就要在代理方法– searchDisplayControllerWillBeginSearch:中捕获button的指针,然后修改button的标题。

     
    3、如果没有搜索到任何结果,则会默认显示,如果想改变提示标题,则需要在代理方法– searchDisplayController:shouldReloadTableForSearchString:中获得Label的指针,然后修改Label的标题。

     

    4、当UISearchDisplayController进入搜索状态时,默认会隐藏当前试图控制器的navigationBar,如果不想隐藏,可以采取两种方式:

    1) 重写当前视图控制器的navigatioinController的getter方法,返回空指针,UISearchDisplayController得不到navigatioinController指针就不会隐藏navigationBar了,如果其他地方需要调用navigatioinController,就调用[supernavigationController].


    2) 写一个UISearchDisplayController的子类,然后重写里面的– setActive:animated:方法,在进入搜索状态的时候,让navigatioinController取消隐藏navigationBar

  • 相关阅读:
    【基础算法】- 全排列
    【基础算法】- 2分查找
    区块链培训
    Static Binding (Early Binding) vs Dynamic Binding (Late Binding)
    test
    No data is deployed on the contract address!
    "throw" is deprecated in favour of "revert()", "require()" and "assert()".
    Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
    京都行
    Failed to write genesis block: database already contains an incompatible
  • 原文地址:https://www.cnblogs.com/flower42/p/3426358.html
Copyright © 2011-2022 走看看