Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mdhansen5

macrumors member
Original poster
Nov 22, 2010
43
0
Colorado
For the UI of the app I'm working on, I'm trying to create rounded corners for the view controller. I have a UINavigationBar and a UITableView. I've already rounded the top 2 corners of the UINavigationBar manually by using a custom background with UIAppearance stuff. Now I want to round the bottom 2 corners of the UITableView so it looks nice. The code I have right now rounds all 4 corners. Anyone know how I can only round the bottom 2?

Here's what I have added right now in my ViewDidLoad method of the UITableViewController. And I have QuartzCore imported.

_tasksTableView.layer.cornerRadius=5;

This line rounds all 4 corners of the UITableView, so I have a rounded UINavigation Bar and a rounded Table View. Doesn't look very good. I'd like to have the 4 corners of the app's window to be rounded.

Thanks to anyone that can help out.
 
How about adjusting the size and y position of the table view so that the top corners are hidden under the nav bar? You'll just have to modify the contentInset (I think that's the one) property of the table view so the content of the table view isn't also hidden under the nav bar.
 
How about adjusting the size and y position of the table view so that the top corners are hidden under the nav bar? You'll just have to modify the contentInset (I think that's the one) property of the table view so the content of the table view isn't also hidden under the nav bar.

Great idea. I'll give it a try. Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.