iOS Table View,更改表格索引的框架

标签 ios uitableview indexing

我正在使用带有搜索栏和范围栏的 TableView。 我在窗口右侧添加了部分索引。

myTableView.tableHeaderView = searchBar;
searchBar.delegate = self;
searchBar.showsCancelButton = YES;
searchBar.showsScopeBar = YES;

第一部分索引绘制在搜索栏和范围栏上方。

如何更改索引列的框架?

谢谢

莱昂内尔

screenshot

最佳答案

那么,tableView 的一两行隐藏在范围栏和搜索栏后面。问题是您需要将 tableView 绑定(bind)到您的 scopeBar。那么它将在您的范围栏下方绑定(bind) tableView。

在你的代码中这样尝试:

//tableView is a table outlet name
//scopeBar is your scope bar outlet name

[tableView setTableHeaderView:scopeBar];

此代码会将您的 tableViewscope bar 绑定(bind)。然后 TableView 行将不在 scope bar 后面 而不是它会显示到那个栏杆

关于iOS Table View,更改表格索引的框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10386142/

相关文章:

sql - 索引中列的顺序有多重要?

iphone - 如何从 iPhone 的字符串中删除标签?

ios - CupertinoTextField 中的 Flutter 文本验证

ios - 点击单元格时从 uitableviewcell 类调用 uipangesture

oracle - Oracle XE 中未启用位图索引

python - pandas loc vs. iloc vs. at vs. iat?

ios - 从 iPod 库读取 m4a 原始数据时如何添加 ADTS header ?

ios - 来自 .xib 的表头 View

swift - 如何为 UITableView 提供动态高度

ios - 如何使用 Swift 为 UITableViewCell 设置动画?