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

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

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -