0

If a UIViewController is launched in landscape mode, even though the home indicator is not on the right side, still the rightmost 44 points on the screen do not respond to touches. I am wondering what is the purpose of disabling those pixels for touches and is there a way to extend the touch area on the right?

Jack
  • 13,571
  • 6
  • 76
  • 98
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131

1 Answers1

0

safearealayoutguide

When the view is visible onscreen, this guide reflects the portion of the view that is not covered by navigation bars, tab bars, toolbars, and other ancestor views. (In tvOS, the safe area reflects the area not covered the screen's bezel.) If the view is not currently installed in a view hierarchy, or is not yet visible onscreen, the layout guide edges are equal to the edges of the view.

As you try to add objects beyond safe area your content get chance clip by Device Bazels.

Example: When you add button outside safe area as

let buttonOutsideSafeArea = UIButton(frame: CGRect(x: 0, y: 100, width: 44, height: 40))
buttonOutsideSafeArea.backgroundColor = .red
self.view.addSubview(buttonOutsideSafeArea)

When you rotate right on device.

enter image description here

But it will get clipped(by Top Notch) when you rotate left

enter image description here

Hence try to avoid adding objects beyond safe Area

Jack
  • 13,571
  • 6
  • 76
  • 98