0

の内部でUITableViewCell、 がカバーする領域はdetailTextLabelの選択を認識しませんcell

セルスタイルはUITableViewCellStyleSubtitle

セルの下部領域全体を選択することはできません。ユーザーはcell、タッチを検出するのに十分な高さでセルをタップする前に、複数回タップすることがあります。

背景色をクリアに設定しようとし[[myCell detailTextLabel] setUserInteractionEnabled:NO]たり、同様のケースで役に立ちましたが、他に何ができますか?

ここで答えが見つからない場合は、セルの代わりにUILabelaを追加することを考えました。subviewdetailTextLabel

編集 - 要求に応じて

ここからのコードは次のとおりですcellForRowAtIndexPath

    NSString *cellId = @"cell";

    locationsCell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if(locationsCell == nil) {
        locationsCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];
    }
    [[locationsCell textLabel] setFont:[UIFont fontWithName:@"Optima-Bold" size:18]];
    [[locationsCell textLabel] setText:@"Choose your location"];
    [[locationsCell detailTextLabel] setFont:[UIFont fontWithName:@"Optima" size:14]];
    [[locationsCell detailTextLabel] setText:@"Tap to select"];
    [[locationsCell detailTextLabel] setBackgroundColor:[UIColor clearColor]];
    return locationsCell;

編集申し訳ありませんが、私は台無しにしてしまいました。別のテーブルにフッター ビューを設定しましたが、2 つのテーブルに条件を追加する代わりに、セルを選択できないようにする明確なフッター ビューが追加されました。フッターを削除しましたが、機能しています。

4

1 に答える 1