开发者

Custom table cell background image

开发者 https://www.devze.com 2023-02-17 05:11 出处:网络
I\'m 开发者_JAVA技巧taking my first stab at the three20 iPhone framework and I can\'t seem to figure out how to change the background of a table cell to a UIImage instead of just the color.Can anyone

I'm 开发者_JAVA技巧taking my first stab at the three20 iPhone framework and I can't seem to figure out how to change the background of a table cell to a UIImage instead of just the color. Can anyone help me out?


You can set the backgroundColor of the cell's contentView with an image pattern like this:

cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];

This will work if the cell is a UITableViewCell or a three20 TTTableViewCell derivative (since they derive from UITableViewCell)

0

精彩评论

暂无评论...
验证码 换一张
取 消