Center a large UIView using NSLayoutConstraint

前端 未结 2 1699
执笔经年
执笔经年 2021-01-07 14:47

I am new to use Autolayouts, even this is my first try. Whatever I do with it, I end with a white screen as result. Here is my attempt.

I have a UIView,

2条回答
  •  天命终不由人
    2021-01-07 15:09

    Auto Layout Constraints is the best approach to what you are trying to achieve. Auto layout constraints are added automatically when you check the Use Autolayout option in the IB.

    Check out this tutorial which tells more about auto layouts in iOS6 http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

    then you can check this link for the updated autolayout in iOS7 http://www.doubleencore.com/2013/09/auto-layout-updates-in-ios-7/

提交回复
热议问题