meteocool / ios

meteocool iPhone + iPad App in Swift
GNU Affero General Public License v3.0
5 stars 1 forks source link

Conflicting layout constraints #61

Open v4lli opened 3 years ago

v4lli commented 3 years ago

When launching the app:

2021-01-18 23:26:56.604288+0100 meteocool[58665:7334719] [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:0x600003af8140 h=&-& v=&-- UIButton:0x7ff024522cf0.width == 24   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x600003af8190 h=&-& v=&-- UIButton:0x7ff024522cf0.minX == 1.01154*UIView:0x7ff02452d740.width - 24.2769   (active)>",
    "<NSLayoutConstraint:0x600003afc0a0 H:[UIButton:0x7ff024522cf0]-(-2)-|   (active, names: '|':UIView:0x7ff02452d740 )>",
    "<NSLayoutConstraint:0x600003af8780 'UIView-Encapsulated-Layout-Width' UIView:0x7ff02452d740.width == 414   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600003afc0a0 H:[UIButton:0x7ff024522cf0]-(-2)-|   (active, names: '|':UIView:0x7ff02452d740 )>

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.