Uilabel This is the iOS control, which is the UIView subclass, only added on the basis of the UIView text display feature. Uilabel also view courses and UIView categories like
1. Create a View object
2. Configure View Properties
3. Join to Parent View
4. Release of all rights
1. Create an Object
UILabel *alabel = [[UILabel alloc] Initwithframe:cgrectmake (20, 100, 280, 40)];
2. Configuration Properties
(1.) Background color
Alabel.backgroundcolor = [Uicolor Graycolor];
(2) Display text
Alabel.text = @ " Tyyyyyyyrrrrrrrrrrrrrrrmwqqqqqqq346werrrrrrrrdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffjhgggggjhkkkkkkkk Kkkkkkkkkkk,yyyyyy ";
(3) Set the text to its way
Alabel.textalignment = Nstextalignmentcenter;
(4) Set text color
Alabel.attributedtext set the color for each letter
Alabel.textcolor = [Uicolor Redcolor];
(5) Font style and size
Alabel.font = [Uifont systemfontofsize:26];
Alabel.font = [Uifont boldsystemfontofsize:26];
Alabel.font = [Uifont fontwithname:@ "Didot-italic" size:26];
(6) Shadow color
Alabel.shadowcolor = [Uicolor Bluecolor];
Alabel.shadowoffset = Cgsizemake (1, 1);
(7) The new line of VIP label
Alabel.numberoflines = 0;
(8) Whether the label changes the font size according to its width
Alabel.adjustsfontsizetofitwidth = YES;
(9) How the line is intercepted
Alabel.linebreakmode = Nslinebreakbytruncatingmiddle;
3. Join to Parent View
[Containterview Addsubview:alabel];
4. Release of all rights
[Alabel release];
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
UILabel iOS Add text control