Font doesn't match #7

Closed
fulldecent opened this Issue Nov 8, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@fulldecent

This will make the font match Apple's UIKit:

--- a/Classes/ELCTextFieldCell.m
+++ b/Classes/ELCTextFieldCell.m
@@ -39,15 +39,16 @@

                self.leftLabel = [[UILabel alloc] initWithFrame:CGRectZero];
                [_leftLabel setBackgroundColor:[UIColor clearColor]];
-               [_leftLabel setTextColor:[UIColor colorWithRed:.285 green:.376 blue:.541 alpha:1]];
-               [_leftLabel setFont:[UIFont fontWithName:@"Helvetica" size:17]];
-               [_leftLabel setTextAlignment:NSTextAlignmentCenter];
+               [_leftLabel setTextAlignment:NSTextAlignmentRight];
+               self.leftLabel.font = self.textLabel.font;
+               self.leftLabel.textColor = self.textLabel.textColor;
                [self addSubview:_leftLabel];

                self.rightTextField = [[ELCInsetTextField alloc] initWithFrame:CGRectZero];
                _rightTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
                [_rightTextField setDelegate:self];
-               [_rightTextField setFont:[UIFont systemFontOfSize:17]];
+               self.rightTextField.font = self.detailTextLabel.font;
+               self.rightTextField.textColor = self.detailTextLabel.textColor;


--- a/Classes/RootViewController.m
+++ b/Classes/RootViewController.m
@@ -104,10 +104,17 @@

     ELCTextFieldCell *cell = (ELCTextFieldCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (cell == nil) {
-        cell = [[ELCTextFieldCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdenti
+        cell = [[ELCTextFieldCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentif
     }

@jvanmetre

This comment has been minimized.

Show comment
Hide comment
@jvanmetre

jvanmetre Nov 8, 2013

Contributor

I encountered issues with setting the font to the textLabel, and detailTextLabel's font on iOS 6, however it does work on iOS 7. Please see commit 3e640e8.

Contributor

jvanmetre commented Nov 8, 2013

I encountered issues with setting the font to the textLabel, and detailTextLabel's font on iOS 6, however it does work on iOS 7. Please see commit 3e640e8.

@jvanmetre jvanmetre closed this Nov 8, 2013

@fulldecent

This comment has been minimized.

Show comment
Hide comment
@fulldecent

fulldecent Nov 8, 2013

Looks great, thanks!

Looks great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment