Answer to the Core Questions
1. How does the engine resolve conflicting min/max constraints when an inner Auto Layout frame is resized?
Adobe XD’s Auto Layout follows a priority‑based resolution model that is largely inherited from the iOS/macOS layout engine. Each constraint is expressed as a relation (≥ for minimum, ≤ for maximum) and carries an implicit priority. When a nested frame declares a minimum width/height and its parent frame declares a maximum for the same dimension, the engine chooses a size that satisfies the higher‑priority constraint first. If both constraints have equal priority (typically the default 1000 for required), the engine will pick a value that also respects spacing and distribution rules, which can lead to a size that lies between the two limits.
In practice, the outer frame’s constraints dominate unless the inner frame explicitly raises its priority (e.g., by setting a higher content‑hugging or compression‑resistance priority or by making its min/max required). This is why you often see the outer frame “override” the inner frame’s limits even when the inner frame’s min is larger than the outer frame’s max.
2. Does the documentation specify a deterministic rule?
The official Adobe XD documentation does not spell out a deterministic rule for nested min/max conflicts. The behavior is implementation‑dependent but follows the underlying Auto Layout algorithm: required constraints (priority 1000) win over non‑required ones, and when priorities are equal, the engine resolves based on the layout hierarchy and spacing defaults. Because the docs omit explicit priority details, designers must rely on visual debugging and priority inspection to predict outcomes.
Practical Verification Steps
- Inspect Constraint Priorities
- Open the Layer Properties panel for the nested frame.
- Check the Content Hugging and Compression Resistance values for the axis you’re concerned about.
- Higher values (up to 1000) mean the frame will resist stretching beyond its min or shrinking below its max.
- Use the Debug View Hierarchy Tool
- In XD, enable Debug View (or use the inspector if available).
- Look at the generated constraint list for both the parent and child frames.
- Verify that the min/max constants and their priorities match your expectations.
- Toggle Constraints Dynamically
- Programmatically set
isActive to false for either the parent’s max or the child’s min.
- Observe the resulting size change to confirm which constraint is driving the layout.
- Re‑enable the constraint and adjust its priority if needed.
- Adjust Priorities When Needed
- If the child’s min should dominate, set its Content Hugging priority to 1000 for that axis.
- Conversely, to let the parent’s max win, lower the child’s priority or set the parent’s max to required.
What to Check If Results Still Surprise You
When the layout still behaves unpredictably, confirm the following:
- Are both frames using the same layout direction (horizontal vs. vertical)?
- Is any frame set to Fixed size that could be overriding the min/max logic?
- Is the XD version recent enough to include the latest Auto Layout bug fixes (e.g., XD 2025.1+)?
Providing these details will help narrow down whether the issue is a priority mismatch, a fixed-size override, or a version‑specific bug.