KKGridView
KKGridView copied to clipboard
adding image cell is in kk grid view
How do I add images to cells in kkgrid view ?
Add a subview-UIImageView as a property and set its image.
On Jan 7, 2013, at 1:24 AM, martinfreefall [email protected] wrote:
How do I add images to cells in kkgrid view ?
— Reply to this email directly or view it on GitHub.
[cell.contentView addSubview:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tux.png"]]]; ??
As long as you're only doing this once, that'll work. Otherwise, you'll encounter an infinite subviews problem (for example if you do this on every call to cellForItemAtIndex:).
On Jan 7, 2013, at 10:17 PM, martinfreefall [email protected] wrote:
[cell.contentView addSubview:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tux.png"]]]; ??
— Reply to this email directly or view it on GitHub.
http://i1275.photobucket.com/albums/y447/martinfreefall/2013-01-08163341_zps1d72eb00.png
every cell is supposed to have the penguin . but only the last one gets populated
my code is like this
viewdidload { viewForcell = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tux.png"]]; }
- (KKGridViewCell *)gridView:(KKGridView *)gridView cellForItemAtIndexPath:(KKIndexPath *)indexPath { [cell.contentView addSubview:viewForcell]; }
A view can only be on screen once at a time; you should use a separate image view for every cell as its dequeued.
@zadr when using that im getting images that are over layed on each other