Check out example codes for "swift uitableview cell spacing". It will help you in understanding the concepts better.

Code Example 1

// Inside UITableViewCell subclass
override func layoutSubviews() {    
    super.layoutSubviews()

    contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8))
}

Learn ReactJs, React Native from akashmittal.com