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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

減少UITableView部分之間的空間

減少UITableView部分之間的空間

守著一只汪 2019-12-13 09:50:03
有沒(méi)有辦法減少UITableView的兩個(gè)部分之間的空間?我擁有的每個(gè)部分之間大約有15個(gè)像素。我確實(shí)已經(jīng)嘗試過(guò)為返回0 -tableView:heightForFooterInSection:,-tableView:heightForHeaderInSection:但這并沒(méi)有改變?nèi)魏螙|西。有什么建議么?
查看完整描述

3 回答

?
撒科打諢

TA貢獻(xiàn)1934條經(jīng)驗(yàn) 獲得超2個(gè)贊

這有點(diǎn)棘手,但是請(qǐng)嘗試以下代碼:


- (CGFloat)tableView:(UITableView*)tableView 

           heightForHeaderInSection:(NSInteger)section {

    if (section == 0) {

        return 6.0;

    }


    return 1.0;

}


- (CGFloat)tableView:(UITableView*)tableView 

           heightForFooterInSection:(NSInteger)section {

    return 5.0;

}


- (UIView*)tableView:(UITableView*)tableView 

           viewForHeaderInSection:(NSInteger)section {

    return [[UIView alloc] initWithFrame:CGRectZero];

}


- (UIView*)tableView:(UITableView*)tableView 

           viewForFooterInSection:(NSInteger)section {

    return [[UIView alloc] initWithFrame:CGRectZero];

}

相應(yīng)地更改值。要?jiǎng)h除空間,我認(rèn)為0.0將不被接受。最小的理智值似乎是1.0。


查看完整回答
反對(duì) 回復(fù) 2019-12-13
?
POPMUISE

TA貢獻(xiàn)1765條經(jīng)驗(yàn) 獲得超5個(gè)贊

對(duì)于所有想要將距離縮小到0的人,都必須使用:


tableView.sectionHeaderHeight = 0.0;

tableView.sectionFooterHeight = 0.0;

因?yàn)樘峁︰ITableViewDelegate只會(huì)從大于零的浮點(diǎn)數(shù)開(kāi)始產(chǎn)生效果。


-(CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section

{

    return 1.0;

}



-(CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section

{

    return 1.0;

}


-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section

{

    return [[[UIView alloc] initWithFrame:CGRectZero] autorelease];

}


-(UIView*)tableView:(UITableView*)tableView viewForFooterInSection:(NSInteger)section

{

    return [[[UIView alloc] initWithFrame:CGRectZero] autorelease];

}

(將iOS 4.1與XCode 4.0.2結(jié)合使用)


查看完整回答
反對(duì) 回復(fù) 2019-12-13
?
慕尼黑5688855

TA貢獻(xiàn)1848條經(jīng)驗(yàn) 獲得超2個(gè)贊

您必須減少節(jié)的頁(yè)眉/頁(yè)腳高度。然后,節(jié)之間的空間將減小。


試試這個(gè)代碼


這個(gè)對(duì)我有用 :-)


tableView.sectionHeaderHeight = 2.0;

tableView.sectionFooterHeight = 2.0;


查看完整回答
反對(duì) 回復(fù) 2019-12-13
  • 3 回答
  • 0 關(guān)注
  • 679 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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