テーブルビューを使用してリストを表示しています。を持つセルは 1 つだけUITableViewCellStyleValue1です。問題は、上下にスクロールすると、詳細なテキストがうまく表示されないことです。これがコードです。
// テーブル ビュー セルの外観をカスタマイズします。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"セル";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (セル == nil) {
if (indexPath.row == 0)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.textColor = [UIColor whiteColor];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.detailTextLabel.textColor = [UIColor yellowColor];
cell.detailTextLabel.text = @"説明";
}
そうしないと
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.textColor = [UIColor whiteColor];
cell.accessoryType = UITableViewCellAccessoryNone;
}
}
// セルを構成します。
cell.textLabel.text = [radioList objectAtIndex:indexPath.row];
セルを返します。
}
誰かが私を助けることができますか?