uitableviewにカスタムセルをロードするためのチュートリアルを教えてください。アプリケーションでこれが必要です。助けてください。
質問する
3697 次
2 に答える
0
このサンプルチュートリアルが役立つ場合があります。方法の1つは、UITableViewCellクラスを拡張し、カスタムセルにカスタム.XIBを使用することです。まあ、それは一般的な考え方です。
于 2012-12-28T11:24:45.727 に答える
0
以下のコードをお試しください
- (UITableViewCell *)tableView:(UITableView *)myTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"MyCellIdentifier";
SPHTableCell *cell = (SPHTableCell *)[data_Table dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[SPHTableCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
return cell;
}
于 2012-12-28T11:45:21.600 に答える