第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

添加iOS UITableView HeaderView(不是節(jié)標(biāo)題)

添加iOS UITableView HeaderView(不是節(jié)標(biāo)題)

iOS
慕婉清6462132 2019-11-05 16:27:15
我想添加一個表頭(而不是節(jié)頭),例如在聯(lián)系人應(yīng)用程序中: 完全一樣-表格上方圖片旁邊的標(biāo)簽。我希望所有視圖都是可滾動的,所以我不能將它們放在桌子外面。我怎樣才能做到這一點?
查看完整描述

3 回答

?
慕神8447489

TA貢獻1780條經(jīng)驗 獲得超1個贊

您可以在Interface Builder中輕松完成此操作。只需使用表創(chuàng)建視圖,然后將另一個視圖放到表上。這將成為表標(biāo)題視圖。將標(biāo)簽和圖像添加到該視圖。有關(guān)視圖層次結(jié)構(gòu),請參見下面的圖片。 

http://img1.sycdn.imooc.com//5dc1328f00014d4e06980338.jpg


查看完整回答
反對 回復(fù) 2019-11-05
?
波斯汪

TA貢獻1811條經(jīng)驗 獲得超4個贊

在Swift中:


override func viewDidLoad() {

    super.viewDidLoad()


    // We set the table view header.

    let cellTableViewHeader = tableView.dequeueReusableCellWithIdentifier(TableViewController.tableViewHeaderCustomCellIdentifier) as! UITableViewCell

    cellTableViewHeader.frame = CGRectMake(0, 0, self.tableView.bounds.width, self.heightCache[TableViewController.tableViewHeaderCustomCellIdentifier]!)

    self.tableView.tableHeaderView = cellTableViewHeader


    // We set the table view footer, just know that it will also remove extra cells from tableview.

    let cellTableViewFooter = tableView.dequeueReusableCellWithIdentifier(TableViewController.tableViewFooterCustomCellIdentifier) as! UITableViewCell

    cellTableViewFooter.frame = CGRectMake(0, 0, self.tableView.bounds.width, self.heightCache[TableViewController.tableViewFooterCustomCellIdentifier]!)

    self.tableView.tableFooterView = cellTableViewFooter

}


查看完整回答
反對 回復(fù) 2019-11-05
  • 3 回答
  • 0 關(guān)注
  • 1310 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號