0

iCalの実装と同様に実装したいと思います。行を同時に強調表示して編集したい。cellBased テーブルビューを使用しました。私は次のことを試しました。

 [self.tableView editColumn:0 row:[self.array count]-1 withEvent:nil select:YES];
 NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:[self.array count]-1 ];
 [self.tableView selectRowIndexes:indexSet byExtendingSelection:YES];

ただし、上記のコードはすべての行を強調表示しますが、現在の行は強調表示しません。現在の行を強調表示し、同じ行を編集したい。これを達成するためのヒントはありますか?


Mailに似たものを実装したいと思います。項目をクリックすると、行が強調表示され、textField が強調表示されます。左側のアイコンは必要ありません。

4

1 に答える 1

0
Customized the TableViewCell and implemented the drawWithFrame.

-(void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
{
    NSRect newFrame = cellFrame;
    newFrame.origin.x += 50;
    newFrame.origin.y += 2;
    newFrame.size.height -=4;
    [super drawWithFrame:newFrame inView:controlView];
}

次のリンクは、問題の解決に役立ちました。

http://developer.apple.com/library/mac/#samplecode/SourceView/Introduction/Intro.html

于 2012-04-16T13:27:09.030 に答える