首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FSCalendar+Persian:如何改变平日的订单?

FSCalendar+Persian:如何改变平日的订单?
EN

Stack Overflow用户
提问于 2022-08-03 13:12:27
回答 1查看 55关注 0票数 0

我在我的项目中使用了Objective,并使用了FSCalendar+Persian pod。

这是我显示日历的代码:

代码语言:javascript
复制
calendar = [[FSCalendar alloc] initWithFrame:CGRectMake(0, 0, _calendarContainer.frame.size.width, _calendarContainer.frame.size.height)];
calendar.locale = [NSLocale localeWithLocaleIdentifier:@"fa_IR"];
calendar.calendarIdentifier = NSCalendarIdentifierPersian;
calendar.firstWeekday = 1;
calendar.placeholderType = FSCalendarPlaceholderTypeNone;
calendar.dataSource = self;
calendar.delegate = self;

calendar.appearance.headerTitleColor = [UIColor primaryColor];
calendar.appearance.headerTitleFont = [UIFont fontWithName:NSLocalizedString(@"DefaultFontBold", @"") size:15];
calendar.appearance.weekdayTextColor = [UIColor primaryColor];

calendar.appearance.selectionColor = [UIColor clearColor];
calendar.appearance.borderSelectionColor = [UIColor primaryColor];
calendar.appearance.titleSelectionColor = [UIColor primaryColor];

calendar.appearance.titleDefaultColor = [UIColor primaryColor];

calendar.appearance.todayColor = [UIColor primaryColor];
calendar.appearance.titleTodayColor = [UIColor whiteColor];

calendar.appearance.titleFont = [UIFont fontWithName:NSLocalizedString(@"DefaultFont", @"") size:14];

calendar.appearance.titleWeekendColor = [UIColor redColor];
calendar.calendarWeekdayView.weekdayLabels[5].textColor = [UIColor redColor];

[_calendarContainer addSubview:calendar];

在我国,第一周是星期六(شنبه),最后一周是星期五(جمعه)。

我的问题是,我希望第一周是第一列从右边,而不是左边,最后一周是第一列从左边。

我怎样才能解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-20 11:30:14

我发现了问题所在,问题就在这一行代码中:

代码语言:javascript
复制
calendar.locale = [NSLocale localeWithLocaleIdentifier:@"fa_IR"];

我必须将fa_IR改为fa-IR (将下划线改为破折号),问题就解决了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73222366

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档