創(chuàng)建UITableViewHeaderFooterView的子類。
成都創(chuàng)新互聯(lián)公司主要從事網(wǎng)站建設、做網(wǎng)站、網(wǎng)頁設計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務云安,十年網(wǎng)站建設經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:13518219792
使用XIB創(chuàng)建
純代碼創(chuàng)建
-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
}
returnself;
}
純代碼創(chuàng)建,重寫initWithReuseIdentifier方法,在該方法中添加內(nèi)容。
2.控制器中實現(xiàn)代理方法
- (void)viewDidLoad {
[superviewDidLoad];
// Do any additional setup after loading the view.
//XIB創(chuàng)建注冊方式
[self.tableViewregisterNib:[UINibnibWithNibName:@"SectionHeader"bundle:nil]forHeaderFooterViewReuseIdentifier:@"sectionHeader"];
//代碼創(chuàng)建 注冊方式
//[self.tableView registerClass:[ZYSectionHeader class] forHeaderFooterViewReuseIdentifier:@"sectionHeader"];
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
static NSString *reuseId = @"sectionHeader";
SectionHeader *header = (SectionHeader *)[tableViewdequeueReusableHeaderFooterViewWithIdentifier:reuseId];
return header;
}
本文標題:自定義UITableViewSectionHeaderView與FooterView使用注意與重用
網(wǎng)頁鏈接:http://chinadenli.net/article38/gidisp.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供App開發(fā)、虛擬主機、網(wǎng)站維護、做網(wǎng)站、網(wǎng)站營銷、全網(wǎng)營銷推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)