Table View with pattern-from-image background color "smears"

Discussion in 'Mac Programming' started by Starfox, Feb 14, 2012.

  1. Starfox
    Expand Collapse
    macrumors regular

    Joined:
    Apr 7, 2011
    #1
    I have a table view that I set the background color of to a pattern image. Whenever I grab the edge of the window and size it up smears are left in the direction of the resize, like dirty rects not being re-drawn properly. It doesn't happen when I turn off copy-on-scroll for the enclosing scroll view but I'd hate to lose performance to that since my table view is view-based and the views aren't very cheap. Any ideas as to how I can fix that?
     
  2. Sydde
    Expand Collapse
    macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #2
    The dirty, ugly way to handle this might be with a delegate to the window. The delegate can receive a message that live resize is starting: switch off copiesOnScroll; later, the delegate will receive the complementary message that resize is ending, at which point you can turn it back on. See if that works.
     
  3. Starfox
    Expand Collapse
    thread starter macrumors regular

    Joined:
    Apr 7, 2011
    #3
    That sounds extremely hackish - did no one consider that people might use patterns as a background? Do I really have to fight against Cocoa to get this working?
     

Share This Page