【发布时间】:2011-07-08 14:41:36
【问题描述】:
我在 UITableView 的 UITableViewCell 中需要帮助。我的要求如下:
查看转推、列表等 当我点击转发时出现以下
您可以看到转发扩展并在下面显示其他列表和列表以及更多幻灯片。 我想做同样的。 任何类型的帮助都非常感谢,教程链接或任何东西。 谢谢你
【问题讨论】:
标签: iphone objective-c cocoa-touch uitableview
我在 UITableView 的 UITableViewCell 中需要帮助。我的要求如下:
查看转推、列表等 当我点击转发时出现以下
您可以看到转发扩展并在下面显示其他列表和列表以及更多幻灯片。 我想做同样的。 任何类型的帮助都非常感谢,教程链接或任何东西。 谢谢你
【问题讨论】:
标签: iphone objective-c cocoa-touch uitableview
我认为this applelink 可以帮助您,这是表格视图的绝佳示例
【讨论】:
我已经通过使用 tableview header 实现了一个类似的。
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 32)];
UIButton *sectionButton = [UIButton buttonWithType:UIButtonTypeCustom];
sectionButton.tag = section;
sectionButton.frame = customView.frame;
[sectionButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
UILabel *titleLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 32)] autorelease];
titleLabel.textAlignment = UITextAlignmentCenter;
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = [UIFont boldSystemFontOfSize:13];
titleLabel.textColor = [UIColor whiteColor];
NSString *tableHeader = @"table_header_down.png";
switch (section) {
case 0:
titleLabel.text = @"Section1";
tableHeader = showSection1 ? @"table_header_up.png" : @"table_header_down.png";
break;
case 1:
titleLabel.text = @"Section2";
tableHeader = showSection2 ? @"table_header_up.png" : @"table_header_down.png";
break;
case 2:
titleLabel.text = @"Section3";
tableHeader = showSection3 ? @"table_header_up.png" : @"table_header_down.png";
break;
case 3:
titleLabel.text = @"Section4";
tableHeader = showSection4 ? @"table_header_up.png" : @"table_header_down.png";
break;
default:
break;
}
[sectionButton setImage:[UIImage imageNamed:tableHeader] forState:UIControlStateNormal];
[customView addSubview:sectionButton];
[customView addSubview:titleLabel];
return [customView autorelease];
}
然后我根据每个部分对应的布尔值加载单元格,如果Bool 0,则行数返回0,并在Bool 1时返回计数。
【讨论】:
您还可以找到来自 Apple 的 this 示例代码,很有帮助。
【讨论】:
如果您是 Apple 开发人员,请前往 WWDC 视频并查看高级 TableView 视频。它描述了如何完全按照您的要求进行操作。
【讨论】: