2013-08-06 26 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製作。