2011-05-23 99 views
0

我有一個包含多個節的表視圖。我想顯示不同的部分標題標題,並希望在每個部分的右上角以4px的右邊距添加標籤。顯示錶節標題的節標題和自定義視圖

我可以同時實現

- (NSString *)tableView:(UITableView *)iTableView titleForHeaderInSection:(NSInteger)iSection 
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 

實現這一目標?

回答

0

只有他們中的一個會成功調用。 tableView:viewForHeaderInSection:將優先。

定義一個視圖,其中標題標籤和另一個標籤位於右上角,並使用設置的值返回tableView:viewForHeaderInSection: