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

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

iOS 7-如何在表格視圖中顯示日期選擇器?

iOS 7-如何在表格視圖中顯示日期選擇器?

MYYA 2019-11-05 10:51:34
在WWDC 2013視頻中,Apple建議在iOS 7的表格視圖中就位顯示選擇器。如何在表格視圖單元格之間插入視圖并為其設(shè)置動(dòng)畫?
查看完整描述

3 回答

?
守著一只汪

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

使用情節(jié)提要和靜態(tài)表,我可以使用以下代碼獲得相同的結(jié)果。這是一個(gè)很好的解決方案,因?yàn)槿绻性S多形狀奇怪的單元格,或者想讓多個(gè)單元格動(dòng)態(tài)顯示/隱藏,那么此代碼仍然可以使用。


@interface StaticTableViewController: UITableViewController


@property (weak, nonatomic) IBOutlet UITableViewCell *dateTitleCell; // cell that will open the date picker. This is linked from the story board

@property (nonatomic, assign, getter = isDateOpen) BOOL dateOpen;


@end



@implementation StaticTableViewController


-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{


    // This is the index path of the date picker cell in the static table

    if (indexPath.section == 1 && indexPath.row == 1 && !self.isDateOpen){

        return 0;

    }

    return [super tableView:tableView heightForRowAtIndexPath:indexPath];

}


-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];

    [tableView beginUpdates];

    if (cell == self.dateTitleCell){

        self.dateOpen = !self.isDateOpen;

    }

    [tableView reloadData];

    [self.tableView endUpdates];

}


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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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