Set UIView's autoresizing mask programmatically?

前端 未结 5 1174
青春惊慌失措
青春惊慌失措 2021-02-01 00:56

I have to set autoresizingMask programmatically for UIView.

I don\'t know how to implement this.

5条回答
  •  野的像风
    2021-02-01 01:19

    Swift 2.0:

    view.autoresizingMask = [.FlexibleRightMargin, .FlexibleLeftMargin, .FlexibleBottomMargin]
    

提交回复
热议问题