-
Notifications
You must be signed in to change notification settings - Fork 0
Label in Code Objective C 2
Azmal Tech edited this page Dec 27, 2016
·
1 revision
-
UILabel *fromLabel = [[UILabel alloc]initWithFrame:CGRectMake(91, 15, labelSize.width, labelSize.height)];
-
fromLabel.text = text;
-
fromLabel.font = customFont;
-
fromLabel.numberOfLines = 1;
-
fromLabel.baselineAdjustment = UIBaselineAdjustmentAlignBaselines;
-
// or UIBaselineAdjustmentAlignCenters, or UIBaselineAdjustmentNone
-
fromLabel.adjustsFontSizeToFitWidth = YES;
-
fromLabel.adjustsLetterSpacingToFitWidth = YES;
-
fromLabel.minimumScaleFactor = 10.0f/12.0f;
-
fromLabel.clipsToBounds = YES;
-
fromLabel.backgroundColor = [UIColor clearColor];
-
fromLabel.textColor = [UIColor blackColor];
-
fromLabel.textAlignment = NSTextAlignmentLeft;
-
[collapsedViewContainer addSubview:fromLabel];