Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing corner radius of the cells insie a grouped UITableView

After hours of googling I am wondering if it is possible to change the corner radius of a grouped UITableView.

I tried

hoursTable.layer.cornerRadius = 5.0;

but nothing seems to change.

like image 787
Neelesh Avatar asked Apr 20 '12 11:04

Neelesh


2 Answers

Make sure clip sub views of table view alon with ur code hoursTable.layer.cornerRadius = 5.0;

by code [hoursTable setClipsToBounds:YES];

hoursTable.layer.cornerRadius = 5.0;
[hoursTable setClipsToBounds:YES];
like image 54
Ranga Avatar answered Oct 08 '22 08:10

Ranga


Are you sure use <QuartzCore/QuartzCore.h> framework in your app

your method (hoursTable.layer.cornerRadius = 5.0; ) only give you rounded corners without having to add your tableview to a superView or clipping it.

also use

[hoursTable setClipsToBounds:YES];

this is work only ios 3....if you work ios 4 or ios 5x then see SO answer

like image 37
Deepesh Avatar answered Oct 08 '22 06:10

Deepesh