Xuni コントロール > Calendar > 機能 > 外観のカスタマイズ |
次のコード例は、Objective-C またはSwiftでこれらのプロパティを設定する方法を示します。この例では、「クイックスタート」で作成したサンプルを使用します。
calendar.borderColor = UIColor.black
calendar.borderWidth = 5.0
calendar.headerBackgroundColor = UIColor(red: 61 / 255.0, green: 131 / 255.0, blue: 75 / 255.0, alpha: 1.0)
calendar.headerTextColor = UIColor.white
calendar.headerFont = UIFont.boldSystemFont(ofSize: 28.0)
calendar.dayOfWeekFormat = XuniDayOfWeekFormat.D
calendar.dayOfWeekBackgroundColor = UIColor(red: 99 / 255.0, green: 166 / 255.0, blue: 70 / 255.0, alpha: 1.0)
calendar.dayOfWeekTextColor = UIColor.white
calendar.dayOfWeekFont = UIFont.boldSystemFont(ofSize: 20.0)
calendar.dayBorderColor = UIColor(red: 242 / 255.0, green: 242 / 255.0, blue: 242 / 255.0, alpha: 1.0)
calendar.dayBorderWidth = 2
calendar.adjacentDayTextColor = UIColor.gray
calendar.calendarFont = UIFont.systemFont(ofSize: 14.0)
calendar.todayFont = UIFont.italicSystemFont(ofSize: 16.0)
calendar.borderColor = [UIColor blackColor];
calendar.borderWidth = 4.0;
calendar.headerBackgroundColor = [UIColor colorWithRed:61 / 255.0 green:131 / 255.0 blue:75 / 255.0 alpha:1.0];
calendar.headerTextColor = [UIColor whiteColor];
calendar.headerFont = [UIFont boldSystemFontOfSize:28.0];
calendar.dayOfWeekFormat = XuniDayOfWeekFormatD;
calendar.dayOfWeekBackgroundColor = [UIColor colorWithRed:99 / 255.0 green:166 / 255.0 blue:70 / 255.0 alpha:1.0];
calendar.dayOfWeekTextColor = [UIColor whiteColor];
calendar.dayOfWeekFont = [UIFont boldSystemFontOfSize:20.0];
calendar.dayBorderColor = [UIColor colorWithRed:242 / 255.0 green:242 / 255.0 blue:242 / 255.0 alpha:1.0];
calendar.dayBorderWidth = 2;
calendar.adjacentDayTextColor = [UIColor grayColor];
calendar.calendarFont = [UIFont systemFontOfSize:14.0];
calendar.todayFont = [UIFont italicSystemFontOfSize:16.0];