xml Tableview nsxmlparsing

时间:2011-01-12 16:53:52

标签: iphone xml tableview

alt text

看到这个表视图,我在一行中设置了3个标签。第3个标签有更多的文字行。它没有显示我使用了以下代码

//配置单元格。  UILabel * myLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(0,0,300,20)];  UILabel * myLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(5,25,300,22)];  UILabel * myLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(8,50,300,40)];

Book * aBook = [appDelegate.books objectAtIndex:indexPath.row];

    myLabel1.text=aBook.title;
 myLabel2.text=aBook.pubDate;
 myLabel3.text=aBook.description;

// myLabel3.lineBreakMode = UILineBreakModeCharacterWrap;

[cell.contentView addSubview:myLabel1];    [cell.contentView addSubview:myLabel2];    [cell.contentView addSubview:myLabel3];

// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;        //设置单元格

返回单元格;

我应用了characterwrap,wordwrap,numberof lines,sizetofit,adjusttofontsizewidth,但没有取回我的结果。 我需要在第三个标签上显示3行文本我使用了一些对齐,我还需要删除Tableview中的HTML(& mdash)标签,因为我从xml文件中提取数据(NSXMLParsing) 帮帮我

1 个答案:

答案 0 :(得分:1)

您需要查看xml中的实体声明 - 请参阅this之前提出的问题。

相关问题