Reputation: 469
i am coding and ran into a problem. I want spacing between cells and spacing on the side. i tried heightForRowAtIndexPath:
but got spacing on the main controller not between cells! I basically want fake margin between a custom nib UITableViewCell but could not find anything legible in swift on google, I Do not know objective C and would like to do this in swift. could someone tell me what i am doing wrong and how they would fix in in swift? thanks!
Upvotes: 0
Views: 278
Reputation: 670
Hi your problem is logical so for swift and objective c solution would be same.
as you say u r using custom tableviewcell nib u can create this view with marginal space in nib file like
here blue color part is UIView you can add your cell component like label,textfield add here and yellow part is space that you want between cells now load this custom cell .nib in your table with table delegate method you will get the out put way you want.
here you heightForRowAtIndexPath that is use for whole row
hope this will give you idea how to get space
Upvotes: 1
Reputation: 11
You have to create the inner content view to hold all the subviews. Then leave the margin between the inner content view and TableviewCell's content view.
Upvotes: 0