0

I am working with my user interface in Xcode using Storyboard.

I would like to add a table view in the middle of my view controller. My problem is, the table will be shown without any border lines (Just cells separator lines).

Is there anyway to show the border lines?

Thank You.

3 Answers 3

1

It just simple, Try this

tableView.layer.borderWidth = 1.0f;
tableView.layer.borderColor = [UIColor redColor].CGColor; 
Sign up to request clarification or add additional context in comments.

Comments

1

Create IBOutlet of your table and write this code in your viewDidLoad

[tbl.layer setBorderColor:[[[UIColor blackColor] colorWithAlphaComponent:1.0] CGColor]];
[tbl.layer setBorderWidth:3.0f];

Comments

0

Written on this code in your view did load methods and import the QuartzCore framework in the your .h file or .m file.

[tableView.layer setBorderWidth: 1.0];
[tableView.layer setCornerRadius:8.0f];
[tableView.layer setMasksToBounds:YES];
[tableView.layer setBorderColor:[[UIColor blackColor] CGColor]];

this might helps you :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.