我正在使用
AQGridView
类,我正在尝试从XIB加载一个单元格.我已经将UIB设置为UITableView的自定义单元格,但是当我尝试加载单元格时,它只是空白.我想知道是否有更简单的方法来加载XIB.
AQGridViewCell需要从xib加载单元格
- (AQGridViewCell *) gridView: (AQGridView *) gridView cellForItemAtIndex: (NSUInteger) index
{
static NSString * CellIdentifier = @"cellID";
gridCell * cell = (gridCell *)[gridView dequeueReusableCellWithIdentifier: CellIdentifier];
if ( cell == nil ){
gridCell = [[gridViewCell alloc] initWithFrame: CGRectMake(0,0,_gridView.frame.size.width/2-4,
_gridView.frame.size.height/2-8)
reuseIdentifier:CellIdentifier];
cell = gridCell;
self.gridCell = nil;
}
cell.title = @"Test Grid Item";
cell.date = @"Apr. 7, 2011";
return ( cell );
}
最佳答案
Here’s an article,描述了如何使用示例代码从nib加载AQGridViewCell.查看名为“可重用的AQGridViewCell”的部分.
(感谢pt2ph8指出contentView.)
相关文章
转载注明原文:ios – 从XIB加载AQGridViewCell(不工作) - 代码日志