0

I'm using a UITableView with group style. I made some specific changes and the normal view of the cell no longer has the rounded corners on grouping. I would like to remove this and just use the plain style of selection. I tried setting selectedBackgroundView to nil for the cell returned by -(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath, but it doesn't change anything. Is there something else I must set to get this behavior?

As a side note, I do have to use group style and I know its weird that I basically want it to act like a plain style table on selection, but there are certain behaviors inherent to group style tables that I wanted, just not the look.

kailoon
  • 2,131
  • 1
  • 18
  • 33

2 Answers2

1

Instead of setting selectedBackgroundView to nil, I actually added an actual UIView. This seems to work in replacing it. Now I just need to find out how to make it look like the plain one, but this has at least solved my initial problem.

kailoon
  • 2,131
  • 1
  • 18
  • 33
-1
#import <QuartzCore/QuartzCore.h>

then use

CALayer * layer = [table layer];
        [layer setMasksToBounds:YES];
        [layer setCornerRadius:0.0]; //note that when radius is 0, the border is a rectangle
        [layer setBorderWidth:3.0];
        [layer setBorderColor:[[UIColor whiteColor] CGColor]];
  • Where am I adding this? Do you want me to create a class that inherits from UITableViewCell and add this to drawRect? – kailoon Sep 05 '12 at 18:09