0

ここに画像の説明を入力

写真に見られるように、私は tableView ( tableviewController のビュー) を持っています。青いビューはセクションの headerView です。タップすると、いくつかのセルが折りたたまれますが、私の問題は、セルに backGround の最初の部分があることです背景としてのtableView(クラウド)の[この写真では、セルのbackgroundColorをクリアに設定しますが、色を設定すると、左右(写真のLR)の部分がまだそこにあります]

私は試してみます: cell.layer.masksToBounds = YES; および cell.contentView.layer.masksToBounds = YES;

どうすればそれを解決できますか? セルが tableView BackGroundColor [image] の最初の部分を BackGroundColor として取るのはなぜですか?

編集:いくつかのコード(backGroundのようにStoryBoardのすべての値を上書きしています...)

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
    static NSString *CellIdentifier = @"clientCell";
    ClientCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if ([[[[[[DataManager sharedManager] clientsList] objectAtIndex:indexPath.section] objectForKey:@"rewards"] objectAtIndex:indexPath.row] valueForKey:@"description"] != [NSNull null])
  {
    cell.voucherDescription.text = [[[[[[DataManager sharedManager] clientsList]    objectAtIndex:indexPath.section] objectForKey:@"rewards"] objectAtIndex:indexPath.row] valueForKey:@"description"];
  }

 //configure more labels ..

[cell setBackgroundColor:[UIColor clearColor]];
[cell.voucherDescription setFont:[UIFont fontWithName:SharkFontSystemeName size:17]];    
return cell;
}

viewDidLoad で:

 [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]]];
4

1 に答える 1

0

問題を解決するには、viewController を UITableViewController から UIViewController に変更し、tableView を subView として追加します。完全に機能するコードの anyThing を変更する必要はありません。これはバグですか、それとも何か見逃していますか?

于 2012-07-27T00:19:08.110 に答える