Skip to content

iOS preferredMaxLayoutWidth #191

Open

Description

@fabb

In AutoLayout on iOS there is an issue with ambigous intrinsic size for multiline text. There is an ugly workaround using preferredMaxLayoutWidth which lives beside the constraint solver, as it cannot deal with this kind of problem.
How does GSS tackle this?

Activity

  1. Inviz commented on Jun 8, 2015

    @Inviz
    Contributor

    For GSS multiline text is the same as single line. We remeasure intrinsic values and update the system until we find that system is solved. In complex situations it may take 2-3 reflows to get it right (a lot of nested centering).

    GSS (ab)uses the fact that absolutely positioned multiline elements collapse their width. Indeed there's certain non-determenism in undersconstrained systems, e.g. when both height and width is intrinsic. We try to avoid it by leaving one axis constrained, while another is left intrinsic. Due to how CSS text flow works, in 99% we constrain width and measure height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions