我有一個的NSTextField在容器:插入點缺失
[textField setFrameOrigin:NSMakePoint(0, -t.frame.size.height)];
content = [[NSView alloc] init];
[content setWantLayer:YES]
content.layer=[CALayer layer];
[content addSubview:textField];
[content scaleUnitSquareToSize:NSMakeSize(1, -1)];
content.frame=textField.frame;
content.layer.backgroundColor=textBGColor.CGColor;
本身坐落在一個視圖與
[view scaleUnitSquareToSize:NSMakeSize(1, -1)];
這一切都是爲了獲得左上原點的容器TextField和它的工作很好,唯一的問題在於InsertionPoint沒有繪製(至少不在可見框架中)。
我認爲InsertionPoint不是縮放或用TextField轉換。其他可能性是InsertionPoint不能在支持層的View中繪製。
有沒有辦法顯示InsertionPoint光標?
編輯
嘗試了一切準備後,似乎被定位出superviews範圍及其dirtyDrawRect的,因爲它的框架InsertionPoint(和focusRing)不會畫畫。有沒有辦法刪除剪輯的NSView?我需要能夠將我的TextField放置在每個絕對位置上。
當我單擊TextField內部時,TextField應自動變爲FirstResponder。我可以編輯/選擇(選擇正在繪製)/複製文本,只是InsertionPoint不繪製。 – junghans