カレンダーの日付の下に価格を追加したいと思います。次の画像と同じです。iOSのカスタムカレンダー
私はFSCalendar、JTCalendar、awesome-ios-uiのような多くのサードパーティのライブラリを試してみましたが、まだ成功しませんでした。
これには他にライブラリやソリューションがありますか?カレンダーの日付の下に価格ラベルを追加したいと思います。
ご協力いただければ幸いです。
カレンダーの日付の下に価格を追加したいと思います。次の画像と同じです。iOSのカスタムカレンダー
私はFSCalendar、JTCalendar、awesome-ios-uiのような多くのサードパーティのライブラリを試してみましたが、まだ成功しませんでした。
これには他にライブラリやソリューションがありますか?カレンダーの日付の下に価格ラベルを追加したいと思います。
ご協力いただければ幸いです。
iは2であるあなたはセクションの番号を持つカスタムUICollectionView
を使うべきだと思うし、そしてセクション1のセルの数は7で、セクション内のセル数が42 であることを確認してください静的配列のthatsのは数週間は日 のような名前持たせますarrOfWeekDayName = [NSArray arrayWithObjects:@"SUN",@"MON", @"TUE", @"WED", @"THU", @"FRI", @"SAT", nil];
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView
{
return 2;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if (section == 0)
{
return arrOfWeekDayName.count;
}
else{
return 42;
}
}
今の日、あなたのセルに表示したいものは何でも賞金や画像を表示する日付の と第二に名前を付けるショー週間のカスタムUICollectionViewCell
1を取ります。私はUICollectionViewCell
最初の2つのカスタムを取る例えば
はweekCell
であり、第二はdateCell
weekCell
だけ日間 に名前を付け、dateCell
は3つのプロパティlblDate
、lblPrize
、imgCell
持っていて、あなたの条件に応じて追加のショーで一つだけのラベルを持っています。あなたは、この42個のセル のすべての値を必要とする1月の値を記入し、数ヶ月によると、このセルを疥癬
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0)
{
weekCell *cell = (weekCell*)[collectionView dequeueReusableCellWithReuseIdentifier:@“weekCell” forIndexPath:indexPath];
cell.lblDay.text =[arrOfWeekDayName objectAtIndex:indexPath.row];
if (indexPath.row == 0)
{
cell.backgroundColor = [UIColor redColor];
}
else
{
cell.backgroundColor = [UIColor colorWithRed:63.0/255.0f green:65.0/255.0f blue:70.0/255.0f alpha:1.0];
}
return cell;
}
else
{
dateCell *cell = (dateCell*)[collectionView dequeueReusableCellWithReuseIdentifier:@“dateCell" forIndexPath:indexPath];
cell.lblDate.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:12];
cell.lblPrize.text= [NSString strngWithFormat:@“$5”];
cell.imgCell.image = [UIImage imageNamed:@“myImage”];
return cell;
}
}
。 疥癬セルの背景色、あなたならば、この内の混乱の日
FirstDateOfMonth = [CommonOps firstDayOfMonth:currentdate ];
LastDateOfMonth = [CommonOps lastDayOfMonth:currentdate];
if ([self date:date isEqualOrAfter:LastDateOfMonth])
{
cell.lblDateTitle.textColor = [UIColor grayColor];
cell.backgroundColor = [UIColor colorWithRed:209/256. green:209/256. blue:209/256. alpha:.5];
cell.userInteractionEnabled = true;
}
else if ([self date: date isEqualOrBefore: FirstDateOfMonth])
{
cell.lblDateTitle.textColor = [UIColor grayColor];
cell.backgroundColor = [UIColor colorWithRed:209/256. green:209/256. blue:209/256. alpha:.5];
cell.userInteractionEnabled = true;
}
else
{
cell.backgroundColor = [UIColor colorWithRed:243/256. green:221/256. blue:159/256. alpha:.5];
cell.userInteractionEnabled = true;
if ([self date:currentdate isTheSameDayThan:date])
{
ValueToDisplayOnHeaderFirstTime = indexPath.row;
}
cell.lblDateTitle.textColor = [UIColor blackColor];
}
if (indexPath.row == 0 || indexPath.row == 7 || indexPath.row == 14 || indexPath.row == 21 || indexPath.row == 28|| indexPath.row == 35)
{
cell.backgroundColor = [UIColor colorWithRed:250/256. green:195/256. blue:181/256. alpha:.5];
cell.lblDateTitle.textColor = [UIColor redColor];
}
に従って(JTCalendarと混同しないように)あなたのためにこれを構築することができ、私はコメント欄に
すてきな解決策、あなたは解決策を精緻化することができます..... – madhuiOS
JTAppleCalendarをお知らせください。
十分に文書化されているようです。 セットアップが簡単です。 そのライブラリがカレンダーを作成できない場合、私はショックを受けます。私は文字通り約7分で私のカレンダー(完全に設計された)を造りました。
ドキュメントはHere
CocoapodリンクはHere
Githubのリンクを見つけたあなたが使用するライブラリHere
を見つけましたか? –
FSCalendarを使用してください: https://github.com/WenchaoD/FSCalendar –
[たくさんあります](https://www.cocoacontrols.com/search?q=calendar) –