Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableViewWrapperView has a leading and trailing margin with super view on tvOS

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?

like image 462
RayChen Avatar asked Sep 14 '25 18:09

RayChen


1 Answers

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/

like image 51
Jeroen Bakker Avatar answered Sep 16 '25 08:09

Jeroen Bakker