Changing the corner radius of cells grouped in a UITableView

After hours of working in googling, I wonder if it is possible to change the radius of the angle a grouped UITableView.

I tried

hoursTable.layer.cornerRadius = 5.0;

but nothing changes.

+5
source share
3 answers

Make sure that the click sub-items of the table view alon with the code ur hoursTable.layer.cornerRadius = 5.0;

by code [hoursTable setClipsToBounds:YES];

hoursTable.layer.cornerRadius = 5.0;
[hoursTable setClipsToBounds:YES];
+6
source

Are you sure you are using the <QuartzCore/QuartzCore.h>framework in your application.

your method ( hoursTable.layer.cornerRadius = 5.0;) gives you rounded corners without adding your table view to the supervisor or trimming it.

also use

[hoursTable setClipsToBounds:YES];

this only works ios 3 .... if you are running ios 4 or ios 5x then see SO answer

+2

1) UITableViewCell

2) subclass UITableViewand set the separator transparency

3) use these cells in the table view

now here is the important method t implemented in a subclass UITableViewCell

in - (void)drawRect:(CGRect)recttry to make a bezier path to fill and stroke the path by the corner of your corner and the background color ...

You can get the contents of rect self.contentView.framein that you must draw your new bezier path.

+2
source

All Articles