You can create a gradient like the messages app using the CAGradientLayer
.
Now, you can listen to the table view's scrolling using the UIScrollView
delegate API. When scroll occurs, get all the visible cells of your table view, and calculate their frames in the superview (the table view) using convertPoint:toView:
or convertRect:toView:
. You can then make a small calculation of lighter and darker colors depending on the y coordinate.