美文网首页
UIKit-UITableView

UIKit-UITableView

作者: MrDemon_ | 来源:发表于2020-03-24 22:40 被阅读0次

    UIKit系列常见处理办法集合

    局部刷新tabelvie

    //局部section刷新
    NSIndexSet * nd=[[NSIndexSet alloc]initWithIndex:1];//刷新第二个section
    [tview reloadSections:nd withRowAnimation:UITableViewRowAnimationAutomatic];
    //局部cell刷新
    NSIndexPath *te=[NSIndexPath indexPathForRow:2 inSection:0];//刷新第一个section的第二行
    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:te,nil] withRowAnimation:UITableViewRowAnimationMiddle];
    

    UITableView隐藏多余的分割线

    - (void)setExtraCellLineHidden: (UITableView *)tableView{
        UIView *view = [UIView new];
        view.backgroundColor = [UIColor clearColor];
        [tableView setTableFooterView:view];
        [view release];
    }
    

    cell 宽度

    //cell内重写
    - (void)setFrame:(CGRect)frame{
        CGSize  size = CGSizeMake(View_Width, 44);
        frame.size = size;
        [super setFrame:frame];
    }
    

    相关文章

      网友评论

          本文标题:UIKit-UITableView

          本文链接:https://www.haomeiwen.com/subject/bbczyhtx.html