Does anybody know how to create an UITableView with a curved frame, like MacOS downloads (in Dock panel) on iOS?
I tried to use for this the UIBezierPath class, but unfortunally I didn't succeed. For example I did this:
_tableView = [[TVCurveTableView alloc] initWithFrame:CGRectMake(10, self.view.frame.size.height - 130, 70, 160)];
UIBezierPath *bezierPath = [[UIBezierPath alloc]init];
[bezierPath moveToPoint:CGPointMake(10, self.view.frame.size.height - 10)];
[bezierPath addLineToPoint:CGPointMake(40, (self.view.frame.size.height-10) - 160)];
[bezierPath addLineToPoint:CGPointMake(110, (self.view.frame.size.height-10) - 160)];
[bezierPath addLineToPoint:CGPointMake(80, (self.view.frame.size.height-10))];
[bezierPath addLineToPoint:CGPointMake(10, (self.view.frame.size.height-10))];
[bezierPath closePath];
bezierPath.lineWidth = 2;
CAShapeLayer *shapeView = [[CAShapeLayer alloc] init];
[shapeView setPath:bezierPath.CGPath];
shapeView.strokeColor = [UIColor redColor].CGColor;
[_tableView.layer addSublayer:shapeView];
Maybe you have some ideas?
My COBezierTableView
does something similar though not with the tilting of the cells. That would be a nice thing to have as a option though, so maybe I´ll look into it. Fell tree also to deliver a pullrequest yourself if you find a sollution. ;-)
https://github.com/knutigro/COBezierTableView
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With