UITableView backgroundview не работает в текстовой области - PullRequest
0 голосов
/ 20 мая 2011

Я пытаюсь настроить внешний вид моего UITableView, установив backgroundView с UIImageView, но он не работает должным образом, как вы можете видеть на изображении. (работает только для accessoryType и в начале строки перед текстом.)

Кто-нибудь может мне помочь с этим?

Мой код:

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.accessoryType  = UITableViewCellAccessoryDisclosureIndicator;

}

    // Configure the cell.
    NSDictionary *lineaAutobus = [buscamionService objectAtIndex:indexPath.row];

    NSString *lineaAutobusNombre = [lineaAutobus objectForKey:@"nombre_lineaAutobus"];

    [cell setBackgroundView:[[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tableViewCellBg.png"]] autorelease]];
    cell.textLabel.text = lineaAutobusNombre;


return cell;
}

https://www.dropbox.com/s/ubok76ipshei931/Screen%20shot%202011-05-20%20at%206.25.29%20PM.png

1 Ответ

1 голос
/ 20 мая 2011

Возможно, вам нужно установить backgroundColor textLabel в [UIColor clearColor]?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...