已经创建了一个UITableViewCell
,MenuItem
的孩子,其中包含我的自定义表格单元格的功能。我还创建了一个带有自定义单元格的xib文件,并将xib文件中的UITableViewCell
设置为MenuItem
。 xib文件的名称也是MenuItem
。在我UITableViewController
类我在ViewDidLoad
这样做:带定制xib的TableCellView无法加载
UINib *menuItems = [UINib nibWithNibName:@"MenuItem" bundle:nil];
[[self tableView] registerNib:menuItems forCellReuseIdentifier:@"MenuItem"];
但在厦门国际银行文件中使用的背景颜色在细胞中的表显示不被使用。如果我添加一个新标签,它会显示,但背景颜色只是纯白色。有谁知道为什么?编辑:我使用[tableView dequeueReusableCellWithIdentifier:@"MenuItem"];
cellForRowAtIndexPath
。
退房此链接可能是它会帮助你... [此处输入链接的描述] [1]和http://stackoverflow.com/questions/281515/how-to-customize-the-background -color-of-uitableviewcell [1]:http://stackoverflow.com/questions/5166747/why-doesnt-uitableviewcell-background-color-work-set-in-interface-builder –
谢谢,找到了我的答案在那里。 – ptf
不客气... :) –