Changing grouped tables border radius

2019-07-25 15:38发布

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

3条回答
来,给爷笑一个
2楼-- · 2019-07-25 15:53

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

查看更多
劫难
3楼-- · 2019-07-25 15:56

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

查看更多
倾城 Initia
4楼-- · 2019-07-25 16:07

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:

查看更多
登录 后发表回答