Search code examples
iosuitableviewcelluicolorseparator

how to add colour in verticalSeprator UITable


How i can add specific colour in verticalSeperator UITable.I tried with UIColor option but its not working please help me to solve this.

HJTextFieldCell *cell = (HJTextFieldCell *)[_tableView dequeueReusableCellWithIdentifier:textCellIdentifier];
cell.constraint_leftSideOftxtFild.constant = 10.0f;
cell.constraint_heigntOfTxtField.constant  = 30.0f;
cell.lbl_verticalSeprator.hidden =NO;
cell.lbl_verticalSeprator.textColor = [UIColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.098/255.0 alpha:0.22];

Solution

  • Try with background color not text color.

    cell.lbl_verticalSeprator.backgroundColor = [UIColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.098/255.0 alpha:0.22];
    

    and the best way is to use native separator and you can change the color with tableView.separatorColor of UITableview