単一tableViewControllerで2 tableViewsを追加します。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == myTableView1) {
// cell for tableView 1
} else {
// cell for tableView 2
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (tableView == myTableView1) {
//return header section 0
} else {
// return header section 1
}
このようにすべてのデリゲートメソッドを設定します。
高さを固定する方法は? viewDidAppear
で
は
[tableView1 setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height/2)];
[tableView2 setFrame:CGRectMake(0, self.view.frame.size.height/2, self.view.frame.size.width, self.view.frame.size.height/2)];
を設定し、あなたはそれを達成するために2 'UITableView'を使用しようとしましたか? – trungduc
2つのUitableViewを使用すると、これを達成するためのベストプラクティスのようだ。 –
非常にカスタムのタスク、私はUICollectionViewをカスタムのUICollectionViewLayoutで、特定の動作のスティックヘッダーで作成する必要があると思います。または静的な行数がある場合は、Rlyは2つのテーブルを使用します。 – Bimawa