UICollectionView에 표시 할 수있는 LocalNotification을 설정하고 싶습니다. 그러나 UITable에 표시하는 방법 만 알고 있습니다. UITable에서 UIcollectionview로 변환하려면 어떻게해야합니까? UIcollectionview에 배경 이미지가있는 동안 UIlabel에 시간과 날짜를 표시하고 싶습니다.UIcollectionView에 LocalNotification 표시
다음은 로컬 알림을 사용하여 UITable을 작성하는 코드입니다.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of notifications
return [[[UIApplication sharedApplication] scheduledLocalNotifications] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.textColor = [UIColor whiteColor];
// Get list of local notifications
NSArray *notificationArray = [[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *notif = [notificationArray objectAtIndex:indexPath.row];
// Display notification info
[cell.textLabel setText:notif.alertBody];
return cell;
}
무엇을 시도 했습니까? 컬렉션 뷰의 API는 테이블 뷰의 API와 매우 유사합니다. – rdelmar