flkautolayout

Using Auto Layout to have UILabel and UITextField next to each other

断了今生、忘了曾经 提交于 2019-12-01 03:35:36
问题 I am trying to position a UILabel instance label next to a UITextField instance textfield like done in the iOS Settings dialogs. I'm using Auto Layout and constraints with the help of Florian Kuglers FLKAutoLayout extensions (https://github.com/dkduck/FLKAutoLayout). When I set only a leading constraint for the label and a space constraint between label and textfield, the label and textfield widths are adjusted to their content. (bottom picture) But when I set also a trailing constraint for