What is the UIColor of the default UITableView separator?

前端 未结 12 1593
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 15:09

Can anyone tell me the UIColor name or exact RGBA for the default iPhone UITableView separator?

It looks like a light gray color, but it\'s not [UIColor lightGrayC

相关标签:
12条回答
  • 2021-01-31 15:16

    FWIW:

    UIColor *defaultSeparatorColor = [UIColor colorWithRed:0.783922f green:0.783922f blue:0.8f alpha:1.0f];

    This was found simulating iOS 9.0 -- and logging out the floating point values that a UITableView separatorColor has by default. I do not find that this matches any of the values from the other answers, but rather exacts the result of the code in the other answer here where the separatorColor is set via creation of a UITableView *tempTable.

    0 讨论(0)
  • 2021-01-31 15:23
    [UIColor colorWithRed:224/255.0 green:224/255.0 blue:224/255.0 alpha:1.0];
    
    0 讨论(0)
  • 2021-01-31 15:23

    Swift 3

    Just set to nil to revert to default.

    tableView.separatorColor = nil
    
    0 讨论(0)
  • 2021-01-31 15:23

    Screenshot -> Photoshop -> Pick Color Tool -> RGB(227, 227, 229)

    0 讨论(0)
  • 2021-01-31 15:24

    R: 224 G: 224 B: 224

    I hope that helps!

    0 讨论(0)
  • 2021-01-31 15:26

    … in terms of CGContextSetRGBStrokeColor it should be:

    CGContextSetRGBStrokeColor (
       CGContextRef c,
       224.0/255.0,
       224.0/255.0,
       224.0/255.0,
       CGFloat alpha
    );
    

    Quite simple and hopefully a solution for your problem.

    0 讨论(0)
提交回复
热议问题