Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble-iphoneos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2017-09-03 01:43:09 +0300
committerGitHub <noreply@github.com>2017-09-03 01:43:09 +0300
commit5f785d062fb1bbf671ccfa87adce44b0b8801cf1 (patch)
tree9586e2ea764e40866f4f01b16b20e2e0922d072f
parent61b691cfc6d8573f7d616cbef31ae42dc6efece8 (diff)
parent14dfb05ec598a271a4243d33d8b4bbeb754bce69 (diff)
Merge PR #113: MUCertificateCreationView: add constraints for UITextFields in UITableViewCell contentView.
-rw-r--r--Source/Classes/MUCertificateCreationView.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Classes/MUCertificateCreationView.m b/Source/Classes/MUCertificateCreationView.m
index 3c71446..1844d1a 100644
--- a/Source/Classes/MUCertificateCreationView.m
+++ b/Source/Classes/MUCertificateCreationView.m
@@ -38,6 +38,17 @@ static void ShowAlertDialog(NSString *title, NSString *msg) {
#pragma mark -
#pragma mark Initialization
++ (void) configureTableViewConstraintWithCell:(UITableViewCell *)cell andTextField:(UITextField *)textField {
+ [textField setTranslatesAutoresizingMaskIntoConstraints:NO];
+
+ NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:textField attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:[cell contentView] attribute:NSLayoutAttributeTop multiplier:1 constant:1];
+ NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:textField attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:[cell contentView] attribute:NSLayoutAttributeBottom multiplier:1 constant:0];
+ NSLayoutConstraint *left = [NSLayoutConstraint constraintWithItem:textField attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:[cell contentView] attribute:NSLayoutAttributeLeft multiplier:1 constant:110];
+ NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:textField attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:[cell contentView] attribute:NSLayoutAttributeRight multiplier:1 constant:0];
+
+ [[cell contentView] addConstraints:[NSArray arrayWithObjects:top, bottom, left, right, nil]];
+}
+
- (id) init {
if ((self = [super initWithStyle:UITableViewStyleGrouped])) {
[self setContentSizeForViewInPopover:CGSizeMake(320, 480)];
@@ -65,6 +76,8 @@ static void ShowAlertDialog(NSString *title, NSString *msg) {
[_nameField setClearButtonMode:UITextFieldViewModeWhileEditing];
[[_nameCell contentView] addSubview:_nameField];
+ [MUCertificateCreationView configureTableViewConstraintWithCell:_nameCell andTextField:_nameField];
+
_emailCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"MUFavouriteServerDescription"];
[_emailCell setSelectionStyle:UITableViewCellSelectionStyleNone];
[[_emailCell textLabel] setText:email];
@@ -83,6 +96,8 @@ static void ShowAlertDialog(NSString *title, NSString *msg) {
[_emailField setText:_fullName];
[_emailField setClearButtonMode:UITextFieldViewModeWhileEditing];
[[_emailCell contentView] addSubview:_emailField];
+
+ [MUCertificateCreationView configureTableViewConstraintWithCell:_emailCell andTextField:_emailField];
}
return self;
}