2015-08-03 5 views
0

Моя настройка проекта поддерживает как портретную, так и альбомную ориентацию. Тем не менее, я хочу, чтобы один из представленных контроллеров представлений (например, контроллер вида A) мог поворачиваться. Я используюОбозначает ли презентацияViewController с представленнымViewController

override func shouldAutorotate() -> Bool { 
    return false 
} 

override func supportedInterfaceOrientations() -> Int { 
    return Int(UIInterfaceOrientationMask.Portrait.rawValue) 
} 

, чтобы отключить вращение в других контроллерах. Оно работает. Однако, когда А представлены модальна и вращают, контроллер вида Предъявления (скажем, вид контроллер B) отчеты:

2015-08-03 23:34:06.000 Adjimu[4161:181458] Unable to simultaneously satisfy constraints. 
    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:0x7ff055858cd0 V:[UIView:0x7ff055858aa0(1)]>", 
    "<NSLayoutConstraint:0x7ff055856610 UIScrollView:0x7ff055855e20.width == 1.77778*UIScrollView:0x7ff055855e20.height>", 
    "<NSLayoutConstraint:0x7ff05585a180 H:|-(0)-[UIScrollView:0x7ff055855e20] (Names: '|':UIView:0x7ff055858970)>", 
    "<NSLayoutConstraint:0x7ff05585a1d0 V:|-(0)-[UIScrollView:0x7ff055855e20] (Names: '|':UIView:0x7ff055858970)>", 
    "<NSLayoutConstraint:0x7ff05585a220 H:[UIScrollView:0x7ff055855e20]-(0)-| (Names: '|':UIView:0x7ff055858970)>", 
    "<NSLayoutConstraint:0x7ff05585a310 V:[UIScrollView:0x7ff055855e20]-(10)-[UILabel:0x7ff05584ea40'Every Child Needs a Famil...']>", 
    "<NSLayoutConstraint:0x7ff05585a400 V:[UILabel:0x7ff05584ea40'Every Child Needs a Famil...']-(5)-[UIButton:0x7ff055846200]>", 
    "<NSLayoutConstraint:0x7ff05585a720 V:[UIButton:0x7ff055846200]-(5)-[UIView:0x7ff055858aa0]>", 
    "<NSLayoutConstraint:0x7ff05585a810 V:[UIView:0x7ff055858aa0]-(0)-[UITableView:0x7ff05603c800]>", 
    "<NSLayoutConstraint:0x7ff05585a860 V:[UITableView:0x7ff05603c800]-(0)-[_UILayoutGuide:0x7ff0558599f0]>", 
    "<_UILayoutSupportConstraint:0x7ff053dc5570 V:[_UILayoutGuide:0x7ff0558599f0(0)]>", 
    "<_UILayoutSupportConstraint:0x7ff053db64f0 _UILayoutGuide:0x7ff0558599f0.bottom == UIView:0x7ff055858970.bottom>", 
    "<NSLayoutConstraint:0x7ff05585eac0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7ff055858970(667)]>", 
    "<NSLayoutConstraint:0x7ff05585eb10 'UIView-Encapsulated-Layout-Height' V:[UIView:0x7ff055858970(262)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7ff055858cd0 V:[UIView:0x7ff055858aa0(1)]> 

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. 
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful. 
2015-08-03 23:34:06.002 Adjimu[4161:181458] Unable to simultaneously satisfy constraints. 
    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:0x7ff055856610 UIScrollView:0x7ff055855e20.width == 1.77778*UIScrollView:0x7ff055855e20.height>", 
    "<NSLayoutConstraint:0x7ff05585a180 H:|-(0)-[UIScrollView:0x7ff055855e20] (Names: '|':UIView:0x7ff055858970)>", 
    "<NSLayoutConstraint:0x7ff05585a1d0 V:|-(0)-[UIScrollView:0x7ff055855e20] (Names: '|':UIView:0x7ff055858970)>", 
    "<NSLayoutConstraint:0x7ff05585a220 H:[UIScrollView:0x7ff055855e20]-(0)-| (Names: '|':UIView:0x7ff055858970)>", 
    "<NSLayoutConstraint:0x7ff05585a310 V:[UIScrollView:0x7ff055855e20]-(10)-[UILabel:0x7ff05584ea40'Every Child Needs a Famil...']>", 
    "<NSLayoutConstraint:0x7ff05585a400 V:[UILabel:0x7ff05584ea40'Every Child Needs a Famil...']-(5)-[UIButton:0x7ff055846200]>", 
    "<NSLayoutConstraint:0x7ff05585a720 V:[UIButton:0x7ff055846200]-(5)-[UIView:0x7ff055858aa0]>", 
    "<NSLayoutConstraint:0x7ff05585a810 V:[UIView:0x7ff055858aa0]-(0)-[UITableView:0x7ff05603c800]>", 
    "<NSLayoutConstraint:0x7ff05585a860 V:[UITableView:0x7ff05603c800]-(0)-[_UILayoutGuide:0x7ff0558599f0]>", 
    "<_UILayoutSupportConstraint:0x7ff053dc5570 V:[_UILayoutGuide:0x7ff0558599f0(0)]>", 
    "<_UILayoutSupportConstraint:0x7ff053db64f0 _UILayoutGuide:0x7ff0558599f0.bottom == UIView:0x7ff055858970.bottom>", 
    "<NSLayoutConstraint:0x7ff05585eac0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7ff055858970(667)]>", 
    "<NSLayoutConstraint:0x7ff05585eb10 'UIView-Encapsulated-Layout-Height' V:[UIView:0x7ff055858970(262)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7ff055856610 UIScrollView:0x7ff055855e20.width == 1.77778*UIScrollView:0x7ff055855e20.height> 

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. 
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful. 

я использую Автокомпоновку в B, и я не хочу его вращаться. Я сделал несколько экспериментов, и эти ошибки ограничения - это те же ошибки, что и при повороте. Я подозреваю, что B также вращается, но он невидим.

Меня беспокоила эта проблема в течение нескольких дней. Я действительно хочу знать, почему это произошло и как решить эту проблему?

ответ

0

Возможно, this ответ может вам помочь.

Котировка (четвёртая абзац ответа):

[...] Раствор два UIWindow сложены друг на друга, каждый вращающийся (или нет) с его собственной точки зрения корневой контроллер. [...]

(Примечание: третий абзац содержит основное сообщение объяснения).

Надеюсь, это поможет.

Смежные вопросы