Reputation: 1204
I've got a somewhat weird problem. I wanted to set a background image for a UITableView
, but I also wanted to apply specific UIImageView
methods on it, so I created a UIImageView
underneath the UItableView
and set the background color of the UITableView
to [UIColor clearColor]
. However, when I'm viewing my image in the simulator, the image looks a bit darker than in the imagepreviewer on mac. How is this possible?
For referenence, here is a screenshot that indicates the difference: http://cl.ly/image/2L0S18273m3O
Upvotes: 0
Views: 97
Reputation: 38728
You shouldn't have to add a view behind the tableView as UITableView
has a backgroundView property that you should set instead.
self.tableView.backgroundView = ({
[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"your-image"]];
});
Upvotes: 1
Reputation: 60
This works for me: Setting your UIImageView as a subview of your table view (in storyboard drag image view onto tableview), then setting the background colour of the table view to be white => colours in simulator and storyboard are the same.
Upvotes: 0