【버그】iOS 14.2 이후의 iPad에서 UITextField를 포커스하면 LayoutConstraints의 경고가 나온다

개요



iOS14.2 이상의 iPad에서 UITextField를 포커스하면 다음 경고가 기록됩니다. iOS 14.1 이전의 iPad에서는 발생하지 않으므로 OS 버그 일 것입니다.
2021-02-11 16:22:34.675060+0900 UITextField Test[4986:357247] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x60000072d8b0 h=--& v=--& _UIButtonBarButton:0x7fd672506e80.height == 0   (active)>",
    "<NSLayoutConstraint:0x60000075b840 _UIUCBKBSelectionBackground:0x7fd67250e6c0.bottom == _UIButtonBarButton:0x7fd672506e80.bottom - 6   (active)>",
    "<NSLayoutConstraint:0x60000075b7a0 V:|-(6)-[_UIUCBKBSelectionBackground:0x7fd67250e6c0]   (active, names: '|':_UIButtonBarButton:0x7fd672506e80 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000075b840 _UIUCBKBSelectionBackground:0x7fd67250e6c0.bottom == _UIButtonBarButton:0x7fd672506e80.bottom - 6   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2021-02-11 16:22:34.675483+0900 UITextField Test[4986:357247] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x60000072dc20 h=--& v=--& _UIButtonBarButton:0x7fd67250e840.height == 0   (active)>",
    "<NSLayoutConstraint:0x60000075bb10 _UIUCBKBSelectionBackground:0x7fd67250f150.bottom == _UIButtonBarButton:0x7fd67250e840.bottom - 6   (active)>",
    "<NSLayoutConstraint:0x60000075ba70 V:|-(6)-[_UIUCBKBSelectionBackground:0x7fd67250f150]   (active, names: '|':_UIButtonBarButton:0x7fd67250e840 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000075bb10 _UIUCBKBSelectionBackground:0x7fd67250f150.bottom == _UIButtonBarButton:0x7fd67250e840.bottom - 6   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2021-02-11 16:22:34.685123+0900 UITextField Test[4986:357247] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x60000072d540 h=--& v=--& _UIButtonBarButton:0x7fd672506cc0.height == 0   (active)>",
    "<NSLayoutConstraint:0x60000075ada0 V:|-(6)-[_UIUCBKBSelectionBackground:0x7fd67250ddf0]   (active, names: '|':_UIButtonBarButton:0x7fd672506cc0 )>",
    "<NSLayoutConstraint:0x60000075ad00 _UIUCBKBSelectionBackground:0x7fd67250ddf0.bottom == _UIButtonBarButton:0x7fd672506cc0.bottom - 6   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000075ad00 _UIUCBKBSelectionBackground:0x7fd67250ddf0.bottom == _UIButtonBarButton:0x7fd672506cc0.bottom - 6   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2021-02-11 16:22:34.687963+0900 UITextField Test[4986:357247] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x60000072f2a0 h=--& v=--& _UIButtonBarButton:0x7fd66241b560.height == 0   (active)>",
    "<NSLayoutConstraint:0x60000072ea80 _UIUCBKBSelectionBackground:0x7fd66241c260.bottom == _UIButtonBarButton:0x7fd66241b560.bottom - 6   (active)>",
    "<NSLayoutConstraint:0x60000072e9e0 V:|-(6)-[_UIUCBKBSelectionBackground:0x7fd66241c260]   (active, names: '|':_UIButtonBarButton:0x7fd66241b560 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000072ea80 _UIUCBKBSelectionBackground:0x7fd66241c260.bottom == _UIButtonBarButton:0x7fd66241b560.bottom - 6   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2021-02-11 16:22:34.688425+0900 UITextField Test[4986:357247] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x60000072f610 h=--& v=--& _UIButtonBarButton:0x7fd66241c3e0.height == 0   (active)>",
    "<NSLayoutConstraint:0x60000072ed50 _UIUCBKBSelectionBackground:0x7fd66241d1f0.bottom == _UIButtonBarButton:0x7fd66241c3e0.bottom - 6   (active)>",
    "<NSLayoutConstraint:0x60000072ecb0 V:|-(6)-[_UIUCBKBSelectionBackground:0x7fd66241d1f0]   (active, names: '|':_UIButtonBarButton:0x7fd66241c3e0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000072ed50 _UIUCBKBSelectionBackground:0x7fd66241d1f0.bottom == _UIButtonBarButton:0x7fd66241c3e0.bottom - 6   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2021-02-11 16:22:34.688888+0900 UITextField Test[4986:357247] [LayoutConstraints] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x60000072ef30 h=--& v=--& _UIButtonBarButton:0x7fd6624199e0.height == 0   (active)>",
    "<NSLayoutConstraint:0x60000072e710 V:|-(6)-[_UIUCBKBSelectionBackground:0x7fd66241b3e0]   (active, names: '|':_UIButtonBarButton:0x7fd6624199e0 )>",
    "<NSLayoutConstraint:0x60000072e7b0 _UIUCBKBSelectionBackground:0x7fd66241b3e0.bottom == _UIButtonBarButton:0x7fd6624199e0.bottom - 6   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000072e7b0 _UIUCBKBSelectionBackground:0x7fd66241b3e0.bottom == _UIButtonBarButton:0x7fd6624199e0.bottom - 6   (active)>

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

대상 OS



이하의 OS에서의 발생을 시뮬레이터상에서 확인하고 있습니다. iPhone에서는 발생하지 않았습니다.
  • iOS 14.2
  • iOS 14.3
  • iOS 14.4

  • 검증 앱



    아래와 같이 적당히 UITextField를 배치한 앱을 만듭니다. ViewController와 같은 프로그램은 기본값으로 유지됩니다. 물론 이 시점에서는 LayoutContraints 경고가 나오지 않습니다.



    iOS 14.2의 iPad 시뮬레이터에서 실행하고 UITextField를 포커스하면 로그가 출력됩니다.



    당연히 NavigationController는 사용하고 있지 않습니다만, 문제의 제약안에 _UIButtonBarButton 가 있는 것이 수수께끼군요.

    관련 기사



    Apple Developer Forums에서도 비슷한 보고서가 있었습니다.
  • Strange UIButtonBarButton layout errors on all textView, fields and searchbars on iPad only | Apple Developer Forums - htps : //에서 ゔぇぺぺr. 아 ぇ. 코 m/후아루 ms/th레아 d/667441
  • 좋은 웹페이지 즐겨찾기