2013-08-06 24 views
-3

下面的'或'分隔符是如何制作的?它是在节头中使用的图像?定制IOS分隔符

enter image description here

+0

我想这只是一系列的UIButtons和UIViews而不是UITableView。 “或”分隔符只是一个带有预制png文件的UIImageView。 – Fogmeister

+0

请参阅下面的答案。您需要多个委托方法来重新创建。 – dana0550

回答

0

是的,它是用于部分标题的图像。

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制作。