Reputation: 1468
I'm creating a tableview on tvOS. The UITableViewWrapperView
is subview of UITableView
and there is a leading and trailing padding between them. How can I remove these paddings? Thanks?
Upvotes: 4
Views: 1351
Reputation: 63
only following is enough
tableView.insetsLayoutMarginsFromSafeArea = false
Upvotes: 0
Reputation: 2169
I solved it with the following setup:
tableView.contentInsetAdjustmentBehavior = .never
tableView.insetsContentViewsToSafeArea = false
tableView.insetsLayoutMarginsFromSafeArea = false
tableView.preservesSuperviewLayoutMargins = false
Note, remember the tvOS guidelines recommends at least 90px spacing for left and right, and 60px spacing for top and bottom.
https://developer.apple.com/design/human-interface-guidelines/tvos/visual-design/layout/
Upvotes: 4
Reputation: 18898
tvOS table views have a lot of weird quirks. I haven't been able to find a clean solution to this for awhile. For now I've been adding negative constraints to the table view cells.
Upvotes: 0