Search code examples
iosswifttvosapple-tv

Is Constraints necessary for tvos app?


I am new to Apple TV apps development. I have designed few views on storyboard, which is looking nice on Apple TV simulator, but some control's edges are cutting when I am running it on HDMI monitor and actual tv.

I want to know, if constraints are needed to manage UI for different sizes of Tvs? If no, is there any standard Apple has introduced to manage this part?


Solution

  • Using Autolayout is recommended, but not required. However, it's a good chance this isn't your issue. If you're developing a tvOS app, be aware that there is a safe area you need to work with. Many TV's (including some new HDTV's) will cut the edges of the screen off (this is called overscan). The safe area is the part of the screen in the centre that you should ensure all of your important content is in.

    So, for a tvOS app, you should set up your views with the dimensions of 1920x1080, but keep all of your important content, buttons, text etc, inside the centre 1740x960 region. This leaves 90px borders on the sides, and 60px borders on the top and bottom. Those borders should of course still have non-important information, such as your background images etc.

    See here for more details: https://developer.apple.com/tvos/human-interface-guidelines/visual-design/#layout