我有一个使用UITableViewStyleGrouped初始化的UITableView。它包含一个组和一个页脚。我正在页脚高度前面遇到不必要的水平线。如果我将页脚设置为隐藏,则线条(和页脚)消失。在以下示例中,页脚高度设置为144px。我看过这个问题的例子,设置一个透明页脚可以解决问题,但是我不能使用这个黑客,因为我需要一个页脚。使用页脚的UITableView底部不需要的水平线
这里有两个例子。两者都使用单节和页脚:
页脚是非常简单的:
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
//Footer
UIView *footer = [[UITableView alloc] init];
[footer.layer setBorderColor: [[UIColor clearColor] CGColor]]; //Has no effect
[footer.layer setBorderWidth:0]; //Has no effect
//[footer.layer setHidden:YES]; //Hides entire footer and lines
footer.backgroundColor = [UIColor clearColor];
UIButton *button = [ComponentFactory makeForgottenPasswordButton];
[footer addSubview:button];
return footer;
}
我试图隐藏在表视图分隔符:
self.tableView.separatorColor = [UIColor clearColor]; //Has no effect
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; //Has no effect
self.tableView.backgroundColor = [UIColor clearColor];
部分和行:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 2;
}
他们从哪里来,我怎么能隐藏它们?
有一次我想问的问题,为什么使用tableview的登录目的? – Rupesh 2012-03-05 05:57:08
它在iPhone应用程序中很常见。例如Soundcloud – Undistraction 2012-03-05 09:56:10
这将是简单易用的标签和文本框。 – Rupesh 2012-03-05 09:59:14