Skip to content

Instantly share code, notes, and snippets.

@martinpilch
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinpilch/f4a2e735cd6bd3d50084 to your computer and use it in GitHub Desktop.
Save martinpilch/f4a2e735cd6bd3d50084 to your computer and use it in GitHub Desktop.
* Tracktivity : TRSignInInfoCell.m
*
* Copyright (c) 2013, Tapmates s.r.o. (www.tapmates.com).
* Created by martin pilch on 08/07/14.
*
* All rights reserved. This source code can be used only for purposes specified
* by the given license contract signed by the rightful deputy of Tapmates s.r.o.
* This source code can be used only by the owner of the license.
*
* Any disputes arising in respect of this agreement (license) shall be brought
* before the Municipal Court of Prague.
*
*/
#import "TRSignInInfoCell.h"
@interface TRSignInInfoCell ()
@property (nonatomic, readwrite, strong) UILabel *infoLabel;
@property (nonatomic, readwrite, strong) UIView *bgView;
@end
@implementation TRSignInInfoCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if ( self ) {
self.backgroundColor = kTRBlackColorDark;
self.selectionStyle = UITableViewCellSelectionStyleNone;
_bgView = [[UIView alloc] initWithFrame:CGRectZero];
_bgView.backgroundColor = kTRRedColor;
_infoLabel = [[UILabel alloc] init];
_infoLabel.lineBreakMode = NSLineBreakByWordWrapping;
_infoLabel.numberOfLines = 0;
_infoLabel.textAlignment = NSTextAlignmentCenter;
_infoLabel.preferredMaxLayoutWidth = 270.0f;
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"Sign In with your desired credentials and we will send you activation email", @"")];
[attrString addAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"ClearSans-Light" size:12.0f], NSForegroundColorAttributeName: [UIColor whiteColor], NSBackgroundColorAttributeName: [UIColor clearColor]} range:NSMakeRange(0, attrString.string.length)];
_infoLabel.attributedText = attrString;
[self addSubview:_bgView];
[self addSubview:_infoLabel];
TMALVariableBindingsAMNO( _bgView, _infoLabel );
TMAL_ADDS_CENTERX(_infoLabel, self);
TMAL_ADDS_VISUALM( @"H:|-(20)-[_infoLabel]-(20)-|", nil );
TMAL_ADDS_CENTERY(_infoLabel, self);
TMAL_ADDS_VISUALM( @"H:|[_bgView]|", nil );
TMAL_ADDS_VISUALM( @"V:|-(15)-[_bgView]-(15)-|", nil );
TMAL_ADDS_CENTERY(_bgView, self);
}
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment