Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Font doesn't match #7

Closed
fulldecent opened this Issue · 2 comments

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

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
@fulldecent

Looks great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.