I am using corner radius to set rounded border of UITableView, Following is my code
self.tableView.layer.cornerRadius = 8.0
self.tableView.layer.masksToBounds = true
But its showing like this without rounded corner in bottom :(
I am using corner radius to set rounded border of UITableView, Following is my code
self.tableView.layer.cornerRadius = 8.0
self.tableView.layer.masksToBounds = true
But its showing like this without rounded corner in bottom :(
The problem was that I was doing rounding corners in awakeFromNib(), instead you MUST do it in layoutSubviews() and it works nicely.
If your table height is proper then, your second cell inner view's height is greater that its height.
Try removing your inner view from cell or if there is no inner view then check your tableview height.
Thanks.
I set up a quick demo project with a sample viewcontroller containing the following code:
@IBOutlet var tableView: UITableView! {
didSet {
tableView.rowHeight = 44
}
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 2 }
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
return tableView.dequeueReusableCellWithIdentifier("CustomCell", forIndexPath: indexPath)
}
override func viewDidLoad() {
super.viewDidLoad()
tableView.tableFooterView = UIView()
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
tableView.layer.cornerRadius = 10
}
In storyboard the viewcontroller looks like this:
As you can see the tableview has a fixed height of 128pt. Although the tableview contains only two rows with a height of 44pt each (88pt in total) the tableview's corners look fine. So there has to be some other issue in your code.