iOS UITableViewCell imageView
iOS UITableViewCell imageView
- Subject: iOS UITableViewCell imageView
- From: Alex Zavatone <email@hidden>
- Date: Thu, 15 Aug 2013 19:18:02 +0000 (GMT)
Anyone know how to properly set the borderWidth on a UITableViewCell's image.imageView layer?
Setting the layer's borderWidth and borderColor work just fine on a UITableViewCell's layer, when setting them in tableView:cellForRowAtIndexPath, but the same code on the cell.imageView.layer has no effect at all.
I've searched through StackOverflow and have found answers that all look similar, but all with no visual effect on the resulting image.
In Xcode 4.3 on iOS 6.x
This works fine to put very obvious borders around the cell:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.imageView.image = [UIImage imageNamed:@"myImage.png"];
CALayer *layer;
//layer = cell.layer; // -- I work just fine
//layer = cell.imageView.layer; // -- I do nothing
[layer setMasksToBounds:YES];
[layer setCornerRadius:10.0f];
[layer setBorderWidth:10.0f];
If you uncomment the first layer line and run the app, there is a large black border around the cell, but if you uncomment the second and run there is no effect on the image at all.
Any ideas what I'm missing here? Thanks in advance.
- Alex Zavatone
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden