![](/img/trans.png)
[英]How to use Tapku Calendar Framework with NSFetchRequest?
[英]How to customize Tapku calendar?
最終決定將日歷lib用於我的訓練日歷應用程序:
我正在嘗試自定義Tapku日歷...
只是想知道,如何在同一頁面(日歷下)添加表格視圖並更新其單元格?
一旦用戶選擇任何日期,該日期的事件將顯示在表格單元格中。
注意:我正在使用“ DidSelectDate”方法顯示消息。
問題是,如果要在壓延機下方添加表格視圖,則該表格視圖不可見。我該怎么辦? 這是我的工作方式:檢查是否刪除了任何日期:
- (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)d {
NSLog(@"calendarMonthView didSelectDate %@",d);
//[self papulateTable];
//[table reloadData];
[self performSelector:@selector(papulateTable) withObject:nil afterDelay:1.0];
//flagtoCheckSelectedCalendarDate = 1;
//[table reloadData];
}
通過調用重載數據用我的自定義方法填充表:
-(UITableViewCell*)papulateTable
{
listOfTrainings = [[NSMutableArray alloc] init];
[listOfTrainings addObject:@"Objective - C"];
[listOfTrainings addObject:@"C#.Net"];
[listOfTrainings addObject:@"ASP.Net"];
[listOfTrainings addObject:@"JAVA"];
[listOfTrainings addObject:@"Memory management"];
[listOfTrainings addObject:@"Multi Threading app"];
NSString *cellValue = [listOfTrainings objectAtIndex:tempIndexPath.row];
cell.textLabel.text = cellValue;
[table reloadData];
return cell;
}
UITableView有很多重要的方法。
您想要的一些方法:
//Get Visible Cells.
NSArray *cells = [tableview visibleCells];
//Get the index path row of a cell.
NSIndexPath * cellRow = [tableview indexPathForCell:cellPointer];
//Return all visible index row.
NSArray *indexVisibleRows = [tableview indexPathsForVisibleRows];
//Reload Data
[tableview reloadData];
此外,您還有一些委托,可以輕松控制表格視圖:
-ScrollView委托。
-TableView委托。
看看Apple文檔,這里有您需要的一切,只需使用tableview中的exist方法來制定策略。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.