我正在根据随附的示例实现 AQGridView。但我正在使用 xibs,在示例中,代码是:
if ( plainCell == nil )
{
plainCell = [[[ImageDemoGridViewCell alloc] initWithFrame: CGRectMake(0.0, 0.0, 200.0, 150.0)
reuseIdentifier: PlainCellIdentifier] autorelease];
plainCell.selectionGlowColor = [UIColor blueColor];
}
plainCell.image = [UIImage imageNamed: [_imageNames objectAtIndex: index]];
cell = plainCell;
}
我的代码如下所示:
- (AQGridViewCell *) gridView: (AQGridView *)inGridView cellForItemAtIndex: (NSUInteger) index
{
static NSString * FilledCellIdentifier = @"FilledCellIdentifier";
AQGridViewCell * cell = nil;
MagazineCell * filledCell = (MagazineCell *)[gridView dequeueReusableCellWithIdentifier: FilledCellIdentifier];
if ( filledCell == nil ) {
}
filledCell.edicaoLabel.text = [[data objectAtIndex:index] name];
cell = filledCell;
return ( cell );
}
示例 InitWith CGRect,但是当我使用 xibs 时如何初始化单元格?