use*_*560 8 objective-c uitableview uikit ios ios7
我的应用程序包含一个UITableView部分页脚.当用户滚动到tableView的底部时,有时在最后一个单元格和tableFooter之间会出现分隔符插入.此行为不一致.


有没有办法强制此分隔符始终显示或永远不会出现?你们有没有注意到这种不一致的行为?对我来说似乎是一个错误.
编辑
我正在使用
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
UILabel *footer = [[UILabel alloc] init];
footer.backgroundColor = [UIColor whiteColor];
footer.font = [footer.font fontWithSize:15];
footer.textAlignment = NSTextAlignmentCenter;
return footer;
}
Run Code Online (Sandbox Code Playgroud)
但你只能使用它轻松重现同样的问题
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
Run Code Online (Sandbox Code Playgroud)


为此,您必须覆盖UIView用作页脚的标准。
您可以通过重写委托方法来做到这一点-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section。
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
UIView *myFooterView;
// create a view with a label and without a line at the top etc...
return myFooterView;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4373 次 |
| 最近记录: |