From d52c86da9751f221a24c21ec903656e279ba885a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 2 Feb 2014 00:53:45 +0400 Subject: Login info in reveal panel and login flow improvements (not complete) --- Juick/TitleView.m | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Juick/TitleView.m (limited to 'Juick/TitleView.m') diff --git a/Juick/TitleView.m b/Juick/TitleView.m new file mode 100644 index 0000000..3948041 --- /dev/null +++ b/Juick/TitleView.m @@ -0,0 +1,37 @@ +// +// TitleView.m +// Juick +// +// Created by Vitaly on 01.02.14. +// Copyright (c) 2014 com.juick. All rights reserved. +// + +#import "TitleView.h" + +@implementation TitleView + +-(id) initWithImage:(UIImage *)image title:(NSString *)title { + self = [super initWithFrame:CGRectMake(0, 0, 300.0f, 52.0f)]; + if (self) { + self.image = [[UIImageView alloc] init]; + self.image.image = image; + self.title = [[UILabel alloc] init]; + self.title.numberOfLines = 1; + self.title.textAlignment = NSTextAlignmentLeft; + self.title.text = title; + self.title.textColor = [ColorScheme navbarFont]; + [self addSubview:self.image]; + [self addSubview:self.title]; + } + return self; +} + +-(void) layoutSubviews { + [super layoutSubviews]; + self.image.frame = CGRectMake(10, 10, 32, 32); + float textHeight = [UILabel sizeForLabel:self.title width:320.0f].size.height; + self.title.frame = CGRectMake(10 + 32 + 10, 10 + (32 - textHeight) / 2, + self.bounds.size.width - 32 - 10*3, textHeight); +} + +@end -- cgit v1.2.3