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?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Daniel
  • 436
  • 3
  • 14

1 Answers1

3

How about this?
And don't use NSTextFieldAndStepperDatePickerStyle, please...

- (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;
}
bluedome
  • 2,449
  • 1
  • 22
  • 17