cellForRowAt ..のtableviewセルのbackgroundImageをどこに設定すればよいですか?これは私がやった方法で、ちょっとうまくいきますが、backgroundimage()を設定する正しい方法と、その「if」のcell.backgroundView
内側または外側の正しい場所を知りたいです。if(cell==nil)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"RootViewCellIdentifier";
UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image1.png"]];
}
return cell;
}