Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • J JVFloatLabeledTextField
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 26
    • Issues 26
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Jared Verdi
  • JVFloatLabeledTextField
  • Issues
  • #222
Closed
Open
Issue created May 26, 2021 by Eddie Long@parrotbait

Feature Request: Add support for multi-line floating labels and Dynamic Type

The current version of the textField doesn't support Dynamic Type. To do this it would need to ensure that a scaled variant of a UIFont is used for the floating label (or opt-in somehow), can use numberOfLines == 0, word wraps and also sets adjustsFontForContentSizeCategory = YES.

Typically a single line for the floating label is fine but when using Dynamic Type and especially in the larger Accessibility content sizes, a single line will truncate too much of the label - which should be fully visible to users at all times. So it ideally should be possible for it to span multiple lines. This causes layouts and constraints in the example project to break, the floating label overlaps with the textfield content and doesn't resize properly.
I believe that the layouts shouldn't assume that the height of the floating label is equal to the _floatingLabel.font.lineHeight however just replacing that everywhere with _floatingLabel.frame.size.height doesn't correctly adjust the textfield content for the floating label. The example project also assumes that the textfield height is 44. I also tried to change this but was unsuccessful.

Unfortunately, I've managed to get it working on an older version of the library but it's diverged too much from the current version to be able to create a PR.

Simulator Screen Shot - iPod touch (7th generation) - 2021-05-26 at 10 12 48

Assignee
Assign to
Time tracking