Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS表视图,更改表索引的框架_Ios_Uitableview_Indexing - Fatal编程技术网

iOS表视图,更改表索引的框架

iOS表视图,更改表索引的框架,ios,uitableview,indexing,Ios,Uitableview,Indexing,我使用的是带有搜索栏和范围栏的TableView。 我在窗口右侧添加了部分索引 myTableView.tableHeaderView = searchBar; searchBar.delegate = self; searchBar.showsCancelButton = YES; searchBar.showsScopeBar = YES; 第一部分索引绘制在搜索栏和范围栏上方 如何更改索引列的框架 谢谢 莱昂内尔 因此,tableView的一两行隐藏在范围栏和搜索栏后面。问题是您需要将t

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

myTableView.tableHeaderView = searchBar;
searchBar.delegate = self;
searchBar.showsCancelButton = YES;
searchBar.showsScopeBar = YES;
第一部分索引绘制在搜索栏和范围栏上方

如何更改索引列的框架

谢谢

莱昂内尔


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

在代码中尝试以下操作:

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

[tableView setTableHeaderView:scopeBar];

此代码将使用范围栏绑定您的tableView。然后,表视图行将不会位于范围栏后面,而将显示在该范围栏下方。

第一部分索引绘制在搜索栏和范围栏上方是什么意思?请发布屏幕快照。屏幕截图添加到问题中。索引C&D绘制在搜索和范围栏上方。下面的答案可能有用,我不确定。但您需要发布有关设置索引的代码。在我的代码中,UISearchBar绑定到tableView,我在问题中添加了代码片段。