Changing grouped tables border radius

2019-07-25 15:32发布

问题:

Is it possible to change how radius of the grouped UITableView? The rounded corners are way to drastic for my design.

回答1:

I believe that the only way to do this is to provide your own background images for your table cells. You can provide 3 images to have a rounded feel to the UITableView like Apple Does.

in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath set the cell's backgroundView to a UIView with the image you want based on the cell index. This will allow you to set the Top, Middle and Bottom.

This is a pretty good article

http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html

just be sure to dequeueReusableCellWithIdentifier:



回答2:

No, it isn't. You can duplicate it though with a standard tableview and a couple custom background images.



回答3:

You have to change both cell.backgroundView and cell.selectedBackgroundView with a view of your choice.