Have you tried to set auto-resize masks in the view?
theView.autoresizingMask = UIViewAutoresizingNone;
You may need to set it in the content view and / or as an image - it is not clear how the hierarchy of your presentation is structured. However, the frame can be set explicitly (and not automatically changed) by the framework, and in this case this will not work.
If you are trying to create a background image for an entire table cell, you can also try an alternative method, which should set the backgroundColor
cell as follows:
UIImage* someImage = [UIImage imageNamed:@"someImage"]; cell.backgroundColor = [UIColor colorWithPatternImage:someImage];
Remember to make sure that the backgroundColor
all the other views that you place inside is [UIColor clearColor]
so that you can see the background image.
source share