I created a view in Interface Builder with a bunch of labels and an image. When I pushed the view onto a UINavigationController, it worked perfectly. I then inserted the view into a UITableView as a cell (instead); in order to do so, I had to convert change the superclass of its view controller from a UIViewController to a UITableViewCell. However, when the view is displayed inside the table its labels are all positioned correctly but the image is displayed at its original (un-resized) size in the center left of the screen. I cannot seem to change its size or position no matter what I do. Please let me know if you have any idea what the problem might be, as I am completely stumped.
A:
Set the contentMode
of the view that contains the image to UIViewContentModeScaleToFill
, UIViewContentModeScaleAspectFit
or UIViewContentModeScaleAspectFill
.
Nikolai Ruhe
2009-08-29 11:24:20
That doesn't work... thanks, though.
titaniumdecoy
2009-08-31 01:41:08
A:
I figured out what the problem was. UITableViewCell has its own imageView property, which was conflicting with the IBOutlet imageView property in my subclass. I simply had to rename the property in the subclass.
titaniumdecoy
2009-08-31 15:49:45