UIView * view=[[UIView alloc]initWithFrame:CGRectMake_View];
view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"123.jpeg"]];
[self.window addSubview:view];
//button
//UIButtonTypeDetailDisclosure 向右 UIButtonTypeInfoDark没反应 UIButtonTypeRoundedRect圆角
UIButton * button=[UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:[UIImage imageNamed:@"14.png"]forState:UIControlStateNormal];//点14.png 显示7.png
[button setImage:[UIImage imageNamed:@"7.png"]forState:UIControlStateHighlighted];
[button setFrame:CGRectMake_button];
[view addSubview:button];
//button1
UIButton * button1=[UIButton buttonWithType:UIButtonTypeCustom];
button1.frame=CGRectMake_button1;
//button1.backgroundColor=[UIColor redColor];
button1.backgroundColor=[UIColor colorWithRed:(12/255) green:(22/255) blue:(32/255)alpha:1.0]; //自定义颜色
[view addSubview:button1];
//textField
UITextField * field=[[UITextField alloc]initWithFrame:CGRectMake_field];
field.backgroundColor=[UIColor whiteColor];
field.textAlignment=UITextAlignmentRight;//文字在右边
field.font=[UIFont systemFontOfSize:33];//文本框中的文字大小
//让控件失去用户交互 不可编辑
field.userInteractionEnabled = NO;
field.borderStyle =UITextBorderStyleBezel ; //文本框类型
===========================================================
UIView * view=[[UIView alloc]initWithFrame:CGRectMake_View];
view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"123.jpeg"]];
[self.window addSubview:view];
//button
//UIButtonTypeDetailDisclosure 向右 UIButtonTypeInfoDark没反应 UIButtonTypeRoundedRect圆角
UIButton * button=[UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:[UIImage imageNamed:@"14.png"]forState:UIControlStateNormal];//点14.png 显示7.png
[button setImage:[UIImage imageNamed:@"7.png"]forState:UIControlStateHighlighted];
[button setFrame:CGRectMake_button];
[view addSubview:button];
//button1
UIButton * button1=[UIButton buttonWithType:UIButtonTypeCustom];
button1.frame=CGRectMake_button1;
//button1.backgroundColor=[UIColor redColor];
button1.backgroundColor=[UIColor colorWithRed:(12/255) green:(22/255) blue:(32/255)alpha:1.0]; //自定义颜色
[view addSubview:button1];
//textField
UITextField * field=[[UITextField alloc]initWithFrame:CGRectMake_field];
field.backgroundColor=[UIColor whiteColor];
field.textAlignment=UITextAlignmentRight;//文字在右边
field.font=[UIFont systemFontOfSize:33];//文本框中的文字大小
//让控件失去用户交互 不可编辑
field.userInteractionEnabled = NO;
field.borderStyle =UITextBorderStyleBezel ; //文本框类型
[view addSubview:field];
===============================================================
Label 字体
UILabel *label2=[[UILabel alloc]initWithFrame:CGRectMake(33, 33, 99, 66)];
[label2 setNumberOfLines:1];
label2.textColor=[UIColor redColor];
label2.font=[UIFont fontWithName:@"宋体" size:50.0f];
label2.text=@"字符串大小";
======================================
NSString * s=@"字符串字符串大小字符串大小字符串大小字符串大小字符串大小字符串大小字符串大小字符串大小字符串大小字符串大小大小";
UIFont * font=[UIFont fontWithName:@"黑体" size:44.0f];
CGSize size=CGSizeMake(66, 70);
UILabel *label2=[[UILabel alloc]initWithFrame:CGRectZero];
[label2 setNumberOfLines:0];
CGSize labelsize=[s sizeWithFont:font constrainedToSize:size lineBreakMode:UILineBreakModeCharacterWrap]; //折行
//label2.frame=CGRectMake(33, 33, 99, 33);
label2.frame=CGRectMake(33, 33, 55, 55);
label2.textColor=[UIColor blackColor];
label2.font=font;
label2.text=s;