Return to Snippet

Revision: 58929
at August 10, 2012 02:39 by zopebie


Initial Code
- (void)viewDidLoad {

    [super viewDidLoad];

	CGRect labelFrame = CGRectMake(10,10,200,44);
	
	UILabel *myLabel = [[UILabel alloc] initWithFrame:labelFrame];
	
	myLabel.backgroundColor = [UIColor clearColor];
	myLabel.textColor = [UIColor redColor];
	myLabel.font = [UIFont fontWithName:@"Verdana" size:18.0];

	myLabel.numberOfLines = 2;
	myLabel.text = @"Hello World\nSecond line";
	
	myLabel.shadowColor = [UIColor darkGrayColor];
	myLabel.shadowOffset = CGSizeMake(1.0,1.0);
	
	[self.view addSubview:myLabel];
	
	[myLabel release];	
}

Initial URL


Initial Description
Reference: http://iosfonts.com/

Initial Title
Creating UILabel programmatically

Initial Tags
ios

Initial Language
Objective C