Vitalii
Vitalii

Reputation: 11091

How to all left and right margins to Safe Area in iOS?

I have two Stack Views that are constrained to start from a Safe Area.

enter image description here

I want to add some space between them and the beginning of the screen.

Instead of adding margin values to each Stack View, can I make Safe Area smaller to move all elements? Or it is possible to add left padding to Safe Area?

Upvotes: 1

Views: 435

Answers (1)

Bhagyesh
Bhagyesh

Reputation: 144

You can set 'additionalSafeAreaInsets' property of the UIViewController to set safe area insets.

self.additionalSafeAreaInsets = UIEdgeInsetsMake(0, 60, 0, 0);

Upvotes: 1

Related Questions