![](/img/trans.png)
[英]NSTableCellView / NSTextField did end editing notification — without text change?
[英]NSTextField - how to change size and position of text/editing area?
得到它了。 兩者都需要重寫。
- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent
{
aRect.origin.y += 9;
aRect.origin.x += 10;
[super editWithFrame:aRect inView:controlView editor:textObj delegate:anObject event:theEvent];
}
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength
{
aRect.origin.y += 9;
aRect.origin.x += 10;
[super selectWithFrame:aRect inView:controlView editor:textObj delegate:anObject start:selStart length:selLength];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.