Skip to content

View constraint issues #23

@ghost

Description

First of all, thanks for a great component!

Unfortunately in complex layouts I am running into issues with view constraints. In my ViewControllers, I often use a Style Sheet of sorts to set my views correctly since I often add and remove views programmatically. Though everything works with the FlyoutNavigation Menu correctly, I get weird errors when I rotate. This is very likely due to the way that I create the views using the style sheet.

Here is the Error:


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:0x100ec920 h=-&- v=&&- UITableView:0xe95c600.width == UIView:0xc2b0d80.width - 1222",
"NSAutoresizingMaskLayoutConstraint:0x100f53c0 h=-&- v=-&- UIView:0xc2b0d80.width == UIView:0xc2aa780.width + 448",
"NSAutoresizingMaskLayoutConstraint:0x1003cfb0 h=-&- v=-&- UIView:0xc2aa780.width == UIWindow:0xc29aeb0.width",
"NSAutoresizingMaskLayoutConstraint:0xc028970 h=--- v=--- H:[UIWindow:0xc29aeb0(768)]"
)


Will attempt to recover by breaking constraint
NSAutoresizingMaskLayoutConstraint:0x100ec920 h=-&- v=&&- UITableView:0xe95c600.width == UIView:0xc2b0d80.width - 1222


The constraint that actually throws the error is actually a FlyoutNavigation.NavigationTableView-Width Constraint. The debugger fixes it correctly so everything works, but it is clearly still an issue.

Other Details:
--Only happens on iPad.
--My "Style Sheet" is based on the UIScreen.MainScreen, See below:

    public StyleSheet ()
    {
    }

    public static RectangleF GetViewFrame()
    {
        RectangleF frame = UIScreen.MainScreen.Bounds;
        if (IsLandscape) {
            float tempHeight = frame.Height; 
            frame.Height = frame.Width;
            frame.Width = tempHeight;
        }
        frame.Height = frame.Height - statusBarHeight;
        return frame;
    }
Thanks for any help you can provide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions