2013-08-02 40 views
1

編輯:警告,而應用程序轉到風景

所有子視圖都放在控制器的xib中。一切都儘快工作的罰款,直至時間應用在人像模式中運行的iPad模擬器,如模擬器GET旋轉,其打印一些警告:

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:0x855f4c0 V:[MKNumberBadgeView:0x853fb70]-(743)-| (Names: '|':UIView:0x855b3b0)>", 
"<NSLayoutConstraint:0x855f480 V:|-(5)-[MKNumberBadgeView:0x853fb70] (Names: '|':UIView:0x855b3b0)>", 
"<NSAutoresizingMaskLayoutConstraint:0x76b48e0 h=-&- v=-&- UILayoutContainerView:0x8334f10.width == UIWindow:0x8334010.width>", 
"<NSAutoresizingMaskLayoutConstraint:0x76b2ed0 h=-&- v=-&- UITransitionView:0x8336250.height == UILayoutContainerView:0x8334f10.height - 49>", 
"<NSAutoresizingMaskLayoutConstraint:0x767e1d0 h=--- v=--- H:[UIWindow:0x8334010(768)]>", 
"<NSAutoresizingMaskLayoutConstraint:0x7678c40 h=-&- v=-&- UIViewControllerWrapperView:0x76565f0.height == UITransitionView:0x8336250.height>", 
"<NSAutoresizingMaskLayoutConstraint:0x7677290 h=-&- v=-&- UILayoutContainerView:0x83371a0.height == UIViewControllerWrapperView:0x76565f0.height>", 
"<NSAutoresizingMaskLayoutConstraint:0x7675b60 h=-&- v=-&- UINavigationTransitionView:0x83398e0.height == UILayoutContainerView:0x83371a0.height>", 
"<NSAutoresizingMaskLayoutConstraint:0x7674320 h=-&- v=-&- UIViewControllerWrapperView:0xf529bf0.height == UINavigationTransitionView:0x83398e0.height - 20>", 
"<NSAutoresizingMaskLayoutConstraint:0x76729e0 h=-&- v=-&- UIView:0x855b3b0.height == UIViewControllerWrapperView:0xf529bf0.height>" 
) 
Will attempt to recover by breaking constraint <NSLayoutConstraint:0x855f4c0 V:[MKNumberBadgeView:0x853fb70]-(743)-| (Names: '|':UIView:0x855b3b0 )> 

我谷歌退出解決方案,這一點,並找出setTranslatesAutoresizingMaskIntoConstraints但不幸的這些警告仍然在那裏。任何建議/幫助?

+0

發佈顯示您如何創建視圖並添加約束的代碼會更有用。 – rdelmar

+0

@rdelmar所有的視圖和約束都在xib中。 –

回答

0

這兩個約束:

五:| - (5) - [MKNumberBadgeView:0x853fb70]

五:[MKNumberBadgeView:0x853fb70] - (743) - |

告訴你想要一個MKNumberBadgeView從頂部固定5點的這是上海華並從底部743點佈局管理器。 iPad的屏幕寬度爲768點(或高度爲橫向),並且在狀態欄上取下20分只能得到748分。佈局中沒有空間來滿足這些限制,除非你的MKNumberBadgeView是零點高。

您需要在xib中找到約束條件並進行更正。看起來你不太可能需要將徽章視圖的底部固定到其超級視圖的底部,單獨固定頂部並且具有固有高度應該沒問題。

+0

好吧,我想通了。我只需選擇MKNumberBadgeView和位於它下面的按鈕,並在它們之間放置垂直間距。 :) thanx。 –

+0

「 」「, 」「, 」「, 」「,Can you interpret這仍然是我的例外 –

+0

請參閱http://stackoverflow.com/questions/15874806/how-to-find-the-crashing-constraint/15875431#15875431如何解釋這些日誌 – jrturton

相關問題