UILable UIButton

UILabel *lab = [[UILabel alloc] init];
lab.frame = CGRectMake(0,0, 100, 330);
lab.backgroundColor = [UIColor redColor];
lab.text = @"我是江少帅 我是帅锅  我是开发者 我是大帅锅";
lab.textColor = [UIColor greenColor];
lab.textAlignment = NSTextAlignmentRight;
lab.textAlignment = NSTextAlignmentLeft;
lab.textAlignment = NSTextAlignmentCenter;
lab.numberOfLines = 0;
lab.font = [UIFont systemFontOfSize:20];


[self.view addSubview:lab];



UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(140, 100, 150, 90);
[self.view addSubview:btn];

btn.backgroundColor = [UIColor purpleColor];
[btn setTitle:@"帅锅" forState:UIControlStateNormal];
[btn setTitleColor:[UIColor brownColor] forState:UIControlStateNormal];
btn.titleLabel.font = [UIFont systemFontOfSize:20];

[btn setImage:[UIImage imageNamed:@"大logo"] forState:UIControlStateNormal];

// [btn setBackgroundImage:[UIImage imageNamed:@"大logo"] forState:UIControlStateNormal];

你可能感兴趣的:(UILable UIButton)