2016-09-16 63 views
1

头的夫特3管理我有一个的viewController作为标题为部分

class MyController: UIViewController , UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate 

我设置DataSource和使用该故事板 和在这个类我已实施的方法的代表:

  1. tableView titleForHeaderInSection
  2. tableView sectionForSectionIndexTitle
  3. sectionIndexTitles。

我想实现与联系人应用程序具有相同行为的应用程序。 但问题是,部分标题似乎从列表中分离,如果我滚动列表该部分的标题不会滑......

enter image description here

任何帮助,将不胜感激 感谢

回答

0

是一个约束问题,我使用StackView解决了这个问题。我把SearchBar和UITableView放入StackView中,并以这种方式获得垂直对齐。现在是工作。 enter image description here