Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

monthNames搞成中文显示啊 #206

Open
295060456 opened this issue Nov 20, 2020 · 2 comments
Open

monthNames搞成中文显示啊 #206

295060456 opened this issue Nov 20, 2020 · 2 comments

Comments

@295060456
Copy link

  • (NSArray<NSString *> *)monthNames {
    if (!_monthNames) {
    if (self.monthNameType == BRMonthNameTypeFullName) {
    _monthNames = @[@"January", @"February", @"March", @"April", @"May", @"June", @"July", @"August", @"September", @"October", @"November", @"December"];
    } else {
    _monthNames = @[@"Jan", @"Feb", @"Mar", @"Apr", @"May", @"Jun", @"Jul", @"Aug", @"Sep", @"Oct", @"Nov", @"Dec"];
    }
    }
    return _monthNames;
    }
@295060456
Copy link
Author

你这个还是写在m文件里面的,我两条路,要么手动导入,要么runtime 来改

@295060456
Copy link
Author

你要是 固执己见 不加的话 ,这里贴上我的代码:
Ivar ivar = class_getInstanceVariable([BRDatePickerView class], "_monthNames");//必须是下划线接属性
NSArray *_monthNames = @[@"一月份", @"二月份", @"三月份", @"四月份", @"五月份", @"六月份", @"七月份", @"八月份", @"九月份", @"十月份", @"十一月份", @"十二月份"];
object_setIvar(self.datePickerView, ivar, _monthNames);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant