diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2017-09-03 01:42:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-03 01:42:53 +0300 |
commit | 61b691cfc6d8573f7d616cbef31ae42dc6efece8 (patch) | |
tree | de4e09c5ee36bdb6ac4ba502889cbfc54e8ed78c | |
parent | 02e22a919ccc1bdd3593ddd440c8843b51d064b5 (diff) | |
parent | d0c464f9775b2a92be844cc3423c72490ddccfc2 (diff) |
Merge PR #112: Fix text field sizing when editing an access token.
-rw-r--r-- | Source/Classes/MUAccessTokenViewController.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Classes/MUAccessTokenViewController.m b/Source/Classes/MUAccessTokenViewController.m index 3593b91..37f3d0f 100644 --- a/Source/Classes/MUAccessTokenViewController.m +++ b/Source/Classes/MUAccessTokenViewController.m @@ -171,6 +171,15 @@ [[_editingCell contentView] addSubview:editingField]; [editingField release]; + [editingField setTranslatesAutoresizingMaskIntoConstraints:NO]; + + NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:editingField attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:[_editingCell contentView] attribute:NSLayoutAttributeTop multiplier:1 constant:1]; + NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:editingField attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:[_editingCell contentView] attribute:NSLayoutAttributeBottom multiplier:1 constant:0]; + NSLayoutConstraint *left = [NSLayoutConstraint constraintWithItem:editingField attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:[_editingCell contentView] attribute:NSLayoutAttributeLeft multiplier:1 constant:8]; + NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:editingField attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:[_editingCell contentView] attribute:NSLayoutAttributeRight multiplier:1 constant:0]; + + [[_editingCell contentView] addConstraints:[NSArray arrayWithObjects:top, bottom, left, right, nil]]; + [editingField becomeFirstResponder]; } |