Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's an old question but perhaps you still want to know how to do this.</p> <p>I reproduced a tableView like in Stocks/Spotlight. The trick is </p> <pre><code>view.layer.cornerRadius = 10; </code></pre> <p>For this to work you need to include the QuartzCore into the class that you call that property:</p> <pre><code>#import &lt;QuartzCore/QuartzCore.h&gt; </code></pre> <p>I heard that this only works since OS 3.0. But since my application is using core data it wasn't a problem because it was already for OS 3.0 and hight.</p> <p>I created a custom UIView with a subview with cornerRadius 10 and with</p> <pre><code>view.backgroundColor = [UIColor clearColor]; </code></pre> <p>Then you have to place an UITableView grouped style in that subview. You need to set the backgroundColor to clearColor and the separatorColor to clearColor. Then you have to position the tableview inside the rounded corner view, this is done by setting the frame size and origin. My loadView class of my custom UIView looks like this:</p> <pre><code>self.view = [[UIView alloc] init]; self.view.backgroundColor = [UIColor clearColor]; CustomUIViewClass *scherm = [[CustomUIViewClass alloc] init]; CGRect frame; frame.origin.x = 10; frame.origin.y = 50; frame.size.width = 300; frame.size.height = 380; scherm.frame = frame; scherm.clipsToBounds = YES; scherm.layer.cornerRadius = 10; [self.view addSubview:scherm]; CustomUITableViewClass *table = [[CustomUITableViewClass alloc] initWithStyle:UITableViewStyleGrouped]; frame.origin.y = -10; frame.origin.x = -10; frame.size.width = 320; frame.size.height = 400; table.tableView.frame = frame; [scherm addSubview:table.tableView]; </code></pre> <p>I hope you understand my english, maybe I will write a short blog post about this technique with a sample project, will post the link here when I'm ready.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload