iPhone控件之UILabel

- (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];
}
posted @ 2012-03-13 13:03  FoxBabe  阅读(233)  评论(0编辑  收藏  举报