static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@""];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
//cell.backgroundView = [[[CustomCell alloc] init] autorelease];
cell.selectedBackgroundView = [[[CustomCell alloc] init] autorelease];
// At end of function, right before return cell:
cell.textLabel.backgroundColor = [UIColor clearColor];
// Configure the cell.
UILabel *myLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(-30, 3, 300, 22)];
UILabel *myLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(10, 22, 310, 200)];
UILabel *myLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(0, 170, 300, 20)];
Book *aBook = [appDelegate.books objectAtIndex:indexPath.row];
myLabel1.text=aBook.title;
myLabel2.text=aBook.description;
myLabel3.text=aBook.pubDate;
NSString *desc = aBook.description;
if ([desc isEqualToString:nil]) {
NSLog(@"nullll lll ");
}
//myLabel2.textAlignment=UITextAlignmentCenter;
myLabel2.numberOfLines=5;
myLabel2.textColor=[UIColor blueColor];
myLabel2.lineBreakMode=UILineBreakModeWordWrap;
myLabel2.font=[UIFont systemFontOfSize:14];
myLabel3.numberOfLines=1;
myLabel1.numberOfLines=1;
myLabel1.textColor=[UIColor redColor];
myLabel1.font=[UIFont systemFontOfSize:20];
myLabel1.shadowColor=[UIColor redColor];
myLabel1.backgroundColor=[UIColor grayColor];
[cell.contentView addSubview:myLabel1];
[cell.contentView addSubview:myLabel2];
[cell.contentView addSubview:myLabel3];
привет, ребята!У меня есть следующий код, я хочу отобразить это из XML-файла.теперь это рабочая, но статическая высота строки.если у файла xml нет данных, тогда он остается пустым.поэтому я хочу изменить высоту строки в соответствии с данными, которые я предоставляю, используя mylabel1,2,3.text