Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout fix: labels doesn't need constraints on booth sides. #14

Closed
wants to merge 2 commits into from
Closed

Layout fix: labels doesn't need constraints on booth sides. #14

wants to merge 2 commits into from

Conversation

RealBonus
Copy link

Labels requires only one horizontal and one vertical constraint.
Try replace textview's bottom constraint with height constraint, and IB will generate warning. Removing tail and bottom constraints will fix that.

@MoZhouqi
Copy link
Owner

It seems to be a duplicate of #13.

@RealBonus
Copy link
Author

#13 removes width constraint. We can also remove trailing constraint. With trailing, but without width constraints Xcode will generate warning if TextView has it own height constraint, instead of bottom.

@MoZhouqi
Copy link
Owner

As discussed in #13, in order to ensure the textAlignment property works properly, the trailing and width constraints of placeholderLabel are needed.

The console outputs the warning message which is almost because you forget to set the translatesAutoresizingMaskIntoConstraints property of the placeholderTextView to false.

@MoZhouqi
Copy link
Owner

Fixed in d670bb3.

@MoZhouqi MoZhouqi closed this Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants