我正在使用带有搜索栏和范围栏的 TableView。 我在窗口右侧添加了部分索引。
myTableView.tableHeaderView = searchBar;
searchBar.delegate = self;
searchBar.showsCancelButton = YES;
searchBar.showsScopeBar = YES;
第一部分索引绘制在搜索栏和范围栏上方。
如何更改索引列的框架?
谢谢
莱昂内尔
最佳答案
那么,tableView
的一两行隐藏在范围栏和搜索栏后面
。问题是您需要将 tableView 绑定(bind)到您的 scopeBar
。那么它将在您的范围栏下方绑定(bind) tableView。
在你的代码中这样尝试:
//tableView is a table outlet name
//scopeBar is your scope bar outlet name
[tableView setTableHeaderView:scopeBar];
此代码会将您的 tableView
与 scope bar
绑定(bind)。然后 TableView 行将不在 scope bar 后面
而不是它会显示到那个栏杆
。
关于iOS Table View,更改表格索引的框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10386142/