Hi,
I need to change background for the item(UITableViewCell).
And problem is next: when change background with image once it works Ok, but when I change for the second time(after refreshing table) it doesn't change.
It works only when use solid colors for changing(blueColor, greenColor) background.
So here is a code:
How to solve the problem?
Thank you.
I need to change background for the item(UITableViewCell).
And problem is next: when change background with image once it works Ok, but when I change for the second time(after refreshing table) it doesn't change.
It works only when use solid colors for changing(blueColor, greenColor) background.
So here is a code:
PHP:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
MyCell *cell = [[[MyCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
if(...)
{
[cell setMyBackground:@"someBakground.png"];
}
else
{
[cell setMyBackground:@"someBakground2.png"];
}
return cell;
}
. . .
- (void)setMyBackground:(NSString*)anImage
{
[self setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:anImage]]];
}
Thank you.