我正在使用 react-native 的 SectionList 并且无法隐藏数据集空白部分的部分标题。我只想显示部分标题和非空部分的行。
header list sectionheader react-native react-native-sectionlist
我正在使用iPhone SDK和Objective-C,我收到此错误消息:
断言失败 - [UITableView _endCellAnimationsWithContext:],/ SourceCache/UIKit/UIKit-984.38/UITableView.m:774 2010-01-08 13:24:16.842 MyAPP [628:20b]由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无效更新:第1节中的行数无效.更新后的现有部分中包含的行数(1)必须等于更新前的该部分中包含的行数(0),或者减去从该部分插入或删除的行数(0已插入,0已删除).
这是扩展部分的代码:
- (void)checkAction:(id)sender
{
//The button is added as subview on a view and the view is section header custom view
UIButton *Button = (UIButton*)sender;
NSLog(@"Button Tag=%d",Button.tag);
if([[self.MySectionIndexArray objectAtIndex:Button.tag] isEqualToString:@"UP"])
{
[self.MySectionIndexArray replaceObjectAtIndex:Button.tag withObject:@"DOWN"];
[ButtonDrop setBackgroundImage:[UIImage imageNamed:@"Up.png"] forState:UIControlStateNormal];
[TableDashBoard reloadSections:[NSIndexSet indexSetWithIndex:Button.tag] withRowAnimation:UITableViewRowAnimationFade];
}
else
{
[self.MySectionIndexArray replaceObjectAtIndex:Button.tag withObject:@"UP"];
[ButtonDrop setBackgroundImage:[UIImage imageNamed:@"Down.png"] forState:UIControlStateNormal];
}
NSLog(@"self.MySectionIndexArray ka title = %@ at index Number=%d",self.MySectionIndexArray,Button.tag);
}
Run Code Online (Sandbox Code Playgroud) 我想将UITableView的节标题推送到另一个视图控制器的节标题.但我无法找到一种方法来阅读现有的部分标题.现有的节标题是动态构造的,我宁愿重复使用它而不是重新构建它.
if (indexPath.section == 0) {
SecondViewController *secondViewController = [[SecondViewController alloc] init];
secondViewController.strValueHolder = FOO_section.sectionTitle; // FOO Code
[[self navigationController] pushViewController:secondViewController animated:YES];
[secondViewController release];
}
Run Code Online (Sandbox Code Playgroud) 我正在实现ListView的部分,其中我显示自定义节标题,除了传统的字母表作为标题.为了让我实现自定义SectionIndexer正确的,我想了解这两种方法之间的差异getSectionForPosition和getPositionForSection.
我理解(不确定这是否正确)getSectionForPosition返回我们想要在节标题中显示的字母.
我不明白其他方法.此外,它们在任何意义上是否相似(如果有的话)以及它们的不同之处(如果它们存在,我认为它们会这样做:))
任何对此有所了解的人都可以给出答案.感谢您完成问题的时间.
更新:
我已经浏览了这个官方页面的文档; 我正在寻找关于自定义SectionIndex实现的一些详细的见解
我正在尝试获取在nib文件中创建的视图,以用作我的UITableView中的节头.我按照这里描述的第3个选项
http://hons82.blogspot.it/2014/05/uitableviewheader-done-right.html
但是我收到了这个错误
***由于未捕获的异常'NSInternalInconsistencyException'终止应用程序,原因:'为标识符注册的无效nib(sectionHeaderIndentifier) - nib必须包含一个必须是UITableViewHeaderFooterView实例的顶级对象'
这是我正在使用的代码
UINib *sectionHeaderNib = [UINib nibWithNibName:@"headerNib" bundle:nil];
NSString *SectionHeaderViewIdentifier = @"sectionHeaderIndentifier";
[self.tableView registerNib:sectionHeaderNib forHeaderFooterViewReuseIdentifier:SectionHeaderViewIdentifier];
Run Code Online (Sandbox Code Playgroud)
和
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
NSString *SectionHeaderViewIdentifier = @"sectionHeaderIndentifier";
HeaderSection *sectionHeaderView = [self.tableView dequeueReusableHeaderFooterViewWithIdentifier:SectionHeaderViewIdentifier];
return sectionHeaderView;
}
Run Code Online (Sandbox Code Playgroud)
这是我的nib文件的屏幕截图.

如此看来,目前ASTableNode且ASTableView都缺乏的部分页眉/页脚视图支持.
我不仅可以找到一个协议方法:
- (nullable NSString *)tableNode:(ASTableNode *)tableNode titleForHeaderInSection:(NSInteger)section
Run Code Online (Sandbox Code Playgroud)
什么都没有.
委托/ dataSource setter方法已被AsyncDisplayKit拦截,因此我无法使用UIKit的方式来执行此操作.
我在使用AsyncDisplayKit时可以添加节头/页脚视图吗?
uitableview ×4
ios ×2
android ×1
header ×1
list ×1
listview ×1
nib ×1
objective-c ×1
react-native ×1
xcode ×1