0

I'm trying to make a textual NSDatePicker object look exactly like a NSTextField. If I take the standard objects it looks like this:

Standard

The only way I seem to find is making both objects bordered which looks like this:

Bordered

Does anyone know how to make the NSDatePicker border look like the textfield in the first image?

4

1 回答 1

3

这个怎么样?
并且不要使用NSTextFieldAndStepperDatePickerStyle,请...

- (void)viewDidLoad {
    [super viewDidLoad];

    // _picker is NSDatePicker as outlet
    _picker.bordered = NO;
    _picker.wantsLayer = YES;
    _picker.layer.borderWidth = 1;
    _picker.layer.borderColor = [NSColor lightGrayColor].CGColor;
}
于 2015-01-09T14:49:20.897 回答