Popular Posts

There was an error in this gadget

Jun 28, 2011

Label code For iPhone


 

        UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 110, 100)];
         myLabel.text = @"Lorem...";
         [self.view addSubview:myLabel];
        
         myLabel.backgroundColor = [UIColor clearColor]; // [UIColor brownColor];
        myLabel.font = [UIFont fontWithName:@"Zapfino" size: 14.0];
         myLabel.shadowColor = [UIColor grayColor];
         myLabel.shadowOffset = CGSizeMake(1,1);
         myLabel.textColor = [UIColor blueColor];
        myLabel.textAlignment = UITextAlignmentRight; // UITextAlignmentCenter, UITextAlignmentLeft
        
         myLabel.lineBreakMode = UILineBreakModeWordWrap;
         myLabel.numberOfLines = 2; // 2 lines ; 0 - dynamical number of lines
         myLabel.text = @"Lorem ipsum dolor sit\namet...";

No comments:

Post a Comment