Created
January 27, 2012 16:04
-
-
Save unnamedd/1689494 to your computer and use it in GitHub Desktop.
View de login montada através do código
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LoginViewController.m | |
// Videolog | |
// | |
// Created by Thiago Holanda on 1/20/12. | |
// Copyright (c) 2012 | |
// | |
#import "LoginViewController.h" | |
#import "VideologAppDelegate.h" | |
#import "UIColorUtil.h" | |
@implementation LoginViewController | |
@synthesize loginCaptionLabel; | |
@synthesize loginTextField; | |
@synthesize senhaCaptionLabel; | |
@synthesize senhaTextField; | |
- (id)init { | |
if ((self = [super init])) { | |
loginCaptionLabel = [[UILabel alloc] init]; | |
loginCaptionLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:15]; | |
loginCaptionLabel.textColor = [UIColor colorForHex:@"#000000"]; | |
loginCaptionLabel.text = @"Login"; | |
loginTextField = [[UITextField alloc] init]; | |
loginTextField.textAlignment = UITextAlignmentLeft; | |
loginTextField.returnKeyType = UIReturnKeyNext; | |
loginTextField.borderStyle = UITextBorderStyleRoundedRect; | |
senhaCaptionLabel = [[UILabel alloc] init]; | |
senhaCaptionLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:15]; | |
senhaCaptionLabel.textColor = [UIColor colorForHex:@"#000000"]; | |
senhaCaptionLabel.text = @"Senha"; | |
senhaTextField = [[UITextField alloc] init]; | |
senhaTextField.textAlignment = UITextAlignmentLeft; | |
senhaTextField.returnKeyType = UIReturnKeyJoin; | |
senhaTextField.borderStyle = UITextBorderStyleRoundedRect; | |
} | |
return self; | |
} | |
- (void)didReceiveMemoryWarning { | |
// Releases the view if it doesn't have a superview. | |
[super didReceiveMemoryWarning]; | |
// Release any cached data, images, etc that aren't in use. | |
} | |
#pragma mark - View lifecycle | |
// Implement loadView to create a view hierarchy programmatically, without using a nib. | |
- (void)loadView { | |
[super loadView]; | |
loginCaptionLabel.frame = CGRectMake(400, 307, 300, 20); | |
[self.view addSubview:loginCaptionLabel]; | |
loginTextField.frame = CGRectMake(loginCaptionLabel.frame.origin.x, loginCaptionLabel.frame.origin.y + loginCaptionLabel.frame.size.height + 10, 300, 20); | |
[self.view addSubview:loginTextField]; | |
senhaCaptionLabel.frame = CGRectMake(loginTextField.frame.origin.x, loginTextField.frame.origin.y + loginTextField.frame.size.height + 20, 300, 20); | |
[self.view addSubview:senhaCaptionLabel]; | |
senhaTextField.frame = CGRectMake(loginCaptionLabel.frame.origin.x, senhaCaptionLabel.frame.origin.y + senhaCaptionLabel.frame.size.height + 10, 300, 20); | |
[self.view addSubview:senhaTextField]; | |
//VideologAppDelegate *appDelegate = (VideologAppDelegate*)[[UIApplication sharedApplication] delegate]; | |
} | |
/* | |
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
} | |
*/ | |
- (void)viewDidUnload | |
{ | |
[super viewDidUnload]; | |
// Release any retained subviews of the main view. | |
// e.g. self.myOutlet = nil; | |
} | |
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | |
// Return YES for supported orientations | |
return YES; | |
} | |
- (void) dealloc { | |
[loginCaptionLabel release]; | |
[loginTextField release]; | |
[senhaCaptionLabel release]; | |
[senhaTextField release]; | |
[super dealloc]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment