1

この質問をしたいだけです。カスタムセルでdetailTextLabelを使用できますか?カスタムセルに表示する追加情報が必要です。detailTextLabelを使おうとすると、何も表示されません。

カスタムセルの.mコード:

- (void)setUseDarkBackground:(BOOL)flag{
if (flag != useDarkBackground || !self.backgroundView)
{
    useDarkBackground = flag;

    NSString *backgroundImagePath = [[NSBundle mainBundle] pathForResource:useDarkBackground ? @"BGDark" : @"BGLight" ofType:@"png"];
    UIImage *backgroundImage = [[UIImage imageWithContentsOfFile:backgroundImagePath] stretchableImageWithLeftCapWidth:0.0 topCapHeight:1.0];
    self.backgroundView = [[[UIImageView alloc] initWithImage:backgroundImage] autorelease];
    self.backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    self.backgroundView.frame = self.bounds;
}}
4

2 に答える 2

1

追加の詳細を表示したい場合は、カスタムセルでもう1つのUILabelを取得できます

于 2011-07-01T05:25:37.613 に答える
0

detailTextLabelのを使用することもできます UITableViewCell

@property(nonatomic, readonly, retain) UILabel *detailTextLabel

detailTextLabelセルで使用するためのブログ投稿を見てください。

UITableView で複数行のテキスト セルを表示する

于 2011-07-01T05:31:27.410 に答える