带有"个人热点"蓝色条的"Unable to simultaneously satisfy constraints"



当我运行应用程序并启用个人热点时,我只会收到以下警告,因此屏幕顶部有个人热点蓝条。有办法解决这个问题吗?

2016-05-19 09:07:55.589 RemindersPro[591:121237] 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. 
(
    "<NSLayoutConstraint:0x145d7ff30 V:|-(20)-[UIInputSetContainerView:0x145e77b70]   (Names: '|':UITextEffectsWindow:0x145d7e8d0 )>",
    "<NSLayoutConstraint:0x145d307a0 'UIInputWindowController-top' V:|-(0)-[UIInputSetContainerView:0x145e77b70]   (Names: '|':UITextEffectsWindow:0x145d7e8d0 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x145d7ff30 V:|-(20)-[UIInputSetContainerView:0x145e77b70]   (Names: '|':UITextEffectsWindow:0x145d7e8d0 )>
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.
updating
reminderListsStructure of 24 calendars recreated.

我尝试按照调用中状态栏(Unable to Satisfy Constraints)中的建议,通过在AppDelegate中添加以下函数来修复它。不幸的是,它没有起到任何作用。

func application(application: UIApplication, willChangeStatusBarFrame newStatusBarFrame: CGRect) {
    for window in UIApplication.sharedApplication().windows {
        if window.dynamicType.self.description().containsString("UITextEffectsWindow") {
            window.removeConstraints(window.constraints)
        }
    }
}

该错误意味着您添加到个人热点酒吧的两个约束相互冲突,这意味着它们告诉酒吧去两个不同的地方。由于这是不可能的,您可以看到错误。为了解决这个问题,你必须查看你添加到酒吧的约束,看看其中两个是否会把酒吧放在不同的地方。Xcode实际上给了您这两个冲突的约束,在错误中显示了这两个约束。

要摆脱所有限制,请尝试以下操作:

func application(application: UIApplication, willChangeStatusBarFrame newStatusBarFrame: CGRect) {
    for window in UIApplication.sharedApplication().windows {
        window.removeConstraints(window.constraints)
    }
}

相关内容

最新更新