UITableCell color

Discussion in 'iOS Development' started by gojohnnyboi, Jul 29, 2008.

  1. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    How do i set a UITableCell's color from white?

    Help appreciated.

    Thanks,
    -John
  2. errrick

    errrick Active Member

    Joined:
    Jan 14, 2008
    Messages:
    218
    Likes Received:
    32
    UIView has a setBackgroundColor method which receives a CGColorRef, and since UITableCell is an UIView's subclass, it should work as well.

    You might want to look for its UIColor equivalent if you're on 2.0
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55

    Yeah, i patched the SDK headers for iphone-gcc use, and i tried setBackgroundColor and setColor on the cell, but they didn't seem to work. Also, CGColorRef doesn't work anymore. Maybe i did it wrong.

    EDIT: No, I just dont think it works for UIImageAndTextTableCell

    [ cell setBackgroundColor: [ UIColor grayColor ] ];

    no luck

Share This Page