1. 程式人生 > >UITableView 當cell的數量不能佔滿螢幕時 如何在TableFooterView上顯示出直達底部的線來

UITableView 當cell的數量不能佔滿螢幕時 如何在TableFooterView上顯示出直達底部的線來

UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];

    backgroundView.backgroundColor = [UIColor clearColor];

    UIView *timeVLine = [[UIView alloc] initWithFrame:CGRectMake(33, 0, 0.4, 100)];

    [backgroundView addSubview:timeVLine];

    timeVLine.backgroundColor = [UIColor redColor];

    timeVLine.autoresizingMask = UIViewAutoresizingFlexibleHeight;

    tableView.backgroundView = backgroundView;

 

注意:backgroundViewtimeVLine等高