cocoa touch - Using gradient background in UITableViewCell -


possible duplicate:
uitableviewcell custom gradient background, gradient highlight color

hey trying use gradient background of tableview cell , have tried using code:

        uiview *view = [[[uiview alloc] initwithframe:cgrectmake(0, 0, 320, 100)] autorelease];             cagradientlayer *gradient = [cagradientlayer layer];             gradient.frame = view.bounds;             gradient.colors = [nsarray arraywithobjects:(id)[[uicolor blackcolor] cgcolor], (id)[[uicolor whitecolor] cgcolor], nil];             [view.layer insertsublayer:gradient atindex:0];             [cell setbackgroundview:view]; 

any idea why isn't working correctly?

don't add view directly cell, add cell's contentview. ensure when orientations occur, resizing occurs expected , not screwed way. ensure that, in other cases may have other view (such scrollview) embedded in view, scroll fluidly, etc. things work expected when placed they're...expecting.


Comments

Popular posts from this blog

c++ - How to modify context menu of internet explorer using IDocHostUIHandler::ShowContextMenu? -

android - Spacing between the stars of a rating bar? -

c# - Getting "Internal .Net Framework Data Provider error 30" error when column has NULL value -