iphone - How can I replace the imageView in a UITableViewCell? -
I have a type that comes from the UIImageView but adds some extra functionality I can see it in my UITableViewCells But rather rather want to create a new cell layout, so that I can add this image.
When I try to set the image view directly ( For more clarity:? . You can insert your image view in the same room as a normal image view in the same place. WillDisplayCell: forRowAtIndexPath: You can do this, but you can "steal" the image in Get fancy and give Jesus a self.imageView = myImageView ) I get a compilation telling me the error is that the imageView is read only. Is there any way around this or I need to write a new table view cell class
@interface MyImageViewClass: UIImageView {} @end ====================== @interface MyTableCellClass: UITableViewCell {} @end @implementation MyTableCellClass - (zero) setupCell {MyImageView * imageView = [[[MyImageView alloc] init] autorelease]; Self.imageView = imageView; // & LT; There is a lot of options here ---- this is a compilation error thrown by an error code} @end
in tableView , you can set the frame to see your image to match the default one (so you will get Apple's layout argument). After that simply set the image to your image cell instead of the default.
tableView: willDisplayCell: .. . Just set
myImageView.image = imageView.image and clear the image of
imageView this will make it more transparent but a bit more magical.
imageView one type of alcoholic in his class. For work or for accidents you received, you should have no additional yvar or synthetic properties in your class will be bizarre. Search around for "ice swizzle" or "class swizzle"
Comments
Post a Comment