Customize the appearance - zhoupIT/ZPTextView GitHub Wiki
FSCalendar provides two ways to customize the appearance:
• FSCalendarAppearance:used to customization of global appearance properties.
• FSCalendarDelegateAppearance:customization for a day’s appearance properties.
Appearance classification
- [Text color](#Text color)
- Text
- [Background,frame,event bots](#Background,frame,event dots)
- [Other properties](#Other properties)
- [FeedBack or Contact](#FeedBack or Contact)
Text color
• FSCalendarAppearance
• FSCalendarDelegateAppearance
Text
The font size in the cell is auto-adapted by default,and you need to turn off auto-negotiation first. Otherwise the font size will not change.
calendar.appearance.adjustsFontSizeToFitContentSize = NO; // turn off auto-negotiation
Background,frame,event bots
• FSCalendarAppearance
• FSCalendarDelegateAppearance
Other properties
// 1.0=circle,0.0=square,0.0-1.0=angle
@property (assign, nonatomic) CGFloat borderRadius;
Example:
calendar.appearance.borderRadius = 0; // set the square cell
Or the way to achieve FSCalendarDelegateAppearance-calendar:appearance:borderRadiusForDate
Result:
@property (assign, nonatomic) FSCalendarCaseOptions caseOptions;
// delimit typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) {
// month text
FSCalendarCaseOptionsHeaderUsesDefaultCase = 0, // June 2016
FSCalendarCaseOptionsHeaderUsesUpperCase = 1, // JUNE 2016
// week text
FSCalendarCaseOptionsWeekdayUsesDefaultCase = 0 << 4, // Sun、Mon、Tue、Wed、Thu、Fri、Sat; 周日、周一、周二、周三、周四、周五、周六
FSCalendarCaseOptionsWeekdayUsesUpperCase = 1 << 4, // SUN、MON、TUE、WED、THU、FRI、SAT; 周日、周一、周二、周三、周四、周五、周六
FSCalendarCaseOptionsWeekdayUsesSingleUpperCase = 2 << 4, // S、M、T、W、T、F、S; 日、一、二、三、四、五、六
};
####Example:
calendar.appearance.caseOptions = FSCalendarCaseOptionsHeaderUsesUpperCase | FSCalendarCaseOptionsWeekdayUsesUpperCase;
####Result:
/**
* Represent the format of the month displayed.
*/
@property (strong, nonatomic) NSString *headerDateFormat;
####Example:
calendar.appearance.headerDateFormat = @"yyyy年MM月";
####Result:
/**
* The alpha value of month label staying on the fringes.This property controls the transparency of the ‘Last month’ and ‘Next month’ tags at rest.
*/
@property (assign, nonatomic) CGFloat headerMinimumDissolvedAlpha;
####Example:
calendar.appearance.headerMinimumDissolvedAlpha = 0;