代码之家  ›  专栏  ›  技术社区  ›  Oscar Apeland

调整UISearchController搜索栏的插图

  •  0
  • Oscar Apeland  · 技术社区  · 7 年前

    UISearchController 的 searchBar

    enter image description here

    0 回复  |  直到 7 年前
        1
  •  1
  •   kzozfsdg    7 年前

    如果你在使用 UISearchController searchBar 是 实例):

    let directionalMargins = NSDirectionalEdgeInsets(top: 0, leading: 25, bottom: 0, trailing: 25)
    searchController.searchBar.directionalLayoutMargins = directionalMargins