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:26:20 +0300
committerMikkel Krautz <mikkel@krautz.dk>2017-09-03 01:32:14 +0300
commit14dfb05ec598a271a4243d33d8b4bbeb754bce69 (patch)
treee8e1ae75009ad4d3d8f63479d0c156538ffadb06
parent02e22a919ccc1bdd3593ddd440c8843b51d064b5 (diff)
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;
}