tableView 自定义分隔线

来源:互联网 发布:淘宝津贴为什么满 编辑:程序博客网 时间:2024/05/01 05:22
    // 分割线 View

    UIView *lineLabel = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableviewWith, 0.5)];

    lineLabel.backgroundColor = HEADER_LINE_COLOR;

    [headview addSubview:lineLabel];

分割线应该使用 view ,view的高度可 为1, label 至少为2。

修改系统自动 cell 分割线

- (void) setTableview {

    

        // 隐藏cell分割线

        // self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

    

        // 改变iOS7 tableView的分割线长、颜色

    if ([self.tableViewrespondsToSelector:@selector(setSeparatorInset:)]) {

        // cell分隔线距离左边边距 space

         CGFloat space =ViewWidth * 25.0f /750.0f;

        [self.tableViewsetSeparatorInset:UIEdgeInsetsMake(0.0, space,0.0, 0.0)];

        

        // cell分隔线的颜色

        // [self.tableView setSeparatorColor:ColorWithRGBA(18.0, 18.0, 18.0, 10.0)];

    }

}


0 0
原创粉丝点击