1

UITableViewの「トップ」セクションヘッダーを判別する方法はありますか?

「上部セクションヘッダー」とは、UITableView境界の上部に固定されているセクションヘッダーを意味します。

4

3 に答える 3

2

これを使用してセクション番号を取得できます。

NSUInteger sectionNumber = [tableView indexPathForCell: [[[tableView visibleCells] objectAtIndex: 0] section]];

それが役立つことを願っています。

于 2011-07-30T00:16:23.000 に答える
0

SECTION ヘッダー/フッターではなく、TABLE ヘッダー (および TABLE フッター) を意味する場合tableHeaderViewは、UITableView

tableHeaderView Returns an accessory view that is displayed above the table.

@property(nonatomic, retain) UIView *tableHeaderView

SECTION ヘッダーが必要な場合は、UITableViewDelegateメソッドを実装して作成する必要があります-tableView:viewForHeaderInSection:

tableView:viewForHeaderInSection: Asks the delegate for a view object to display in the header of the specified section of the table view.

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
于 2011-07-30T16:36:18.073 に答える
0

-(UIView) viewForHeaderInSection メソッドを使用する必要があります。これにより、独自の UI ビューをテーブル ビュー セクションのヘッダーとして使用できます。

于 2011-07-30T00:19:44.760 に答える