【问题标题】:How to customize Tapku calendar?如何自定义 Tapku 日历?
【发布时间】:2013-01-31 15:31:33
【问题描述】:

最终决定为我的培训日历应用程序使用日历库:

我正在尝试自定义 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];

}

通过调用 reload data 用我的自定义方法填充表格:

-(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;

}

【问题讨论】:

  • 如果你有(错误的)代码,你应该展示你到目前为止得到了什么。
  • 好的。现在它工作了...我在检查条件后调用 [Self ViewDidLoad]。谢谢。

标签: iphone ios objective-c calendar tapku


【解决方案1】:

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];

另外,您有一些委托,可以轻松控制 tableview:

-ScrollView 代表。

-TableView 委托。

看一下苹果文档,有你需要的一切,只需制定策略 通过使用 tableview 中的 exists 方法。

http://developer.apple.com/library/ios/documentation/uikit/reference/UITableView_Class/Reference/Reference.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多