-3

下面的“或”分隔符是如何制作的?它是节标题中使用的图像吗?

在此处输入图像描述

4

3 回答 3

3

如果这真的是通过表格视图完成的,那么它是通过" tableView:viewForHeaderInSection:"的委托方法完成的。

于 2013-08-06T16:47:43.280 回答
0

是的,它是用于节标题的图像。

于 2013-08-06T16:49:53.467 回答
0

该登录页面正在修改 UITableView 的页眉/页脚视图。

当您设置表格视图时,您需要使用以下 UITableView 委托方法,以便在表格视图的每个部分中创建页眉和页脚视图。

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    // Set your custom view for the header in the section
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    // Set your custom view for the footer in the section
}

- (CGFloat) tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section
{
    // Set the height of the header in each section
}

- (CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    // Set the height of the footer in each section
}

注意:如果您注意到前两个方法返回一个 UIView 因此它不必只是一个图像。您可以创建任何您想要的自定义视图并将其放置在 tableView 页眉/页脚中。视图可以是 UIKit 元素、UIImage,甚至是使用 CoreGraphics 制作的。

于 2013-08-06T16:50:20.737 回答