嗨我已經設計了一個XIB使用AutoLayout constriants來顯示兩行按鈕,每行有三個按鈕,如截圖所示(我將按鈕放入紅UIViews後,我得到一個滿意的佈局):iOS 6.0 AutoLayout問題約束:子視圖旋轉時消失
到目前爲止好,在縱向模式下如上圖所示的按鈕看起來很好。但是,當我旋轉橫向標題(藍色)和父視圖(灰色)調整大小並正確顯示,但紅色按鈕視圖正好消失(見下文)。
什麼是設置約束上得到這個工作的權利的最佳途徑?我遵循Ray Wenderlich教程,並使用了他在示例中使用的相同編輯器\ Pin]垂直間距和編輯器\ Pin \ Horizontal間距: Ray Wenderlich tutorial
我也收到了很多約束錯誤,如下所示:
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x859abe0 UIView:0x85a8fb0.height == UIView:0x85a8e60.height>",
"<NSLayoutConstraint:0x859ab60 V:[UIView:0x85a8fb0]-(114)-| (Names: '|':UIView:0x85a8170)>",
"<NSLayoutConstraint:0x859ab20 V:|-(424)-[UIView:0x85a8fb0] (Names: '|':UIView:0x85a8170)>",
"<NSLayoutConstraint:0x85a3430 V:|-(150)-[UIView:0x85a8170] (Names: '|':UIView:0x85a8da0)>",
"<NSLayoutConstraint:0x85a33b0 V:[UIView:0x85a8170]-(NSSpace(20))-| (Names: '|':UIView:0x85a8da0)>",
"<NSAutoresizingMaskLayoutConstraint:0x75ac610 h=--& v=--& V:[UIView:0x85a8da0(704)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x859ab60 V:[UIView:0x85a8fb0]-(114)-| (Names: '|':UIView:0x85a8170)>
Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
我在我的智慧結束與此,所以從這個博學羣的任何幫助將不勝感激......!
我有一個類似的問題,但完全沒有日誌。組織者中唯一提及的是這次事故。我如何在日誌中啓用它們? – 2013-06-02 18:53:16
當然,我以編程方式處理該問題。 – 2013-06-02 18:59:36