0

UITableView にカスタム ヘッダー バーがあり、その下のセルをオーバーラップさせたいと考えています。これが可能かどうか誰にもわかりますか?現時点では、スクロールアップを設定しようとしましたが、うまくいかないようです。誰かアイデアはありますか?

これが私が試したことです

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) return 200;
    else return 100;
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return @"";
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 20;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 30)];
    headerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"hm_pullToRefreshBar.png"]];

    return headerView;
}

編集:ヘッダー ビューに設定した UIView よりもヘッダーの高さを 10 ピクセル短くしようとしましたが、グラフィックをオーバーラップさせるのではなく、グラフィックを切り取るだけです。

4

0 に答える 0