私はカレンダーをカスタマイズするためにMBCalendarKitを使用しています。各カレンダーセルのテキストラベルに追加したい。参考のためにgithub "https://github.com/MosheBerman/MBCalendarKit"のサンプルコードをダウンロードしてください。MBCalendarKitのカレンダーセルコンテンツにラベルを追加する方法は?
編集:
私はループのために使用される複数のラベルを作成します。どうしましたか?
NSMutableArray *dateButtons = [NSMutableArray array];
for (NSInteger i = 1; i <= 42; i++) {
DateButton *dateButton = [DateButton buttonWithType:UIButtonTypeCustom];
dateButton.calendar = self.calendar;
[dateButton addTarget:self action:@selector(_dateButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
UILabel *travelTime = [[UILabel alloc] initWithFrame:CGRectMake(3, 23, 20, 20)];
travelTime.font=[travelTime.font fontWithSize:9];
[travelTime setTextColor:[UIColor blueColor]];
travelTime.text = @"9";
UILabel *workTime = [[UILabel alloc] initWithFrame:CGRectMake(30, 23, 20, 20)];
workTime.font=[workTime.font fontWithSize:9];
[workTime setTextColor:[UIColor orangeColor]];
workTime.text = @"9";
[dateButton addSubview:travelTime];
[dateButton addSubview:workTime];
[dateButtons addObject:dateButton];
}
self.dateButtons = dateButtons;
の作者だそれは質問や答えますか? – rptwsthi