//
// ViewController.m
// test007
//
// Created by yxh on 2019/7/26.
// Copyright © 2019 yxh. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NSLog(@"the UI loaded");
//创建一个简单的UILable
//1.1 创建UILabel
UILabel * label = [[UILabel alloc] init];
//1.2 给Label设置位置和尺寸
label.frame = CGRectMake(30, 100, 300, 200);
//1.3 给Label加文字 背景颜色
label .text = @"我是小灰灰ddddd,我啥技术都敢搞。";
label.textColor = [UIColor yellowColor];
label.backgroundColor = [UIColor greenColor];
//1.4 给Label设置阴影
label.shadowColor = [UIColor blackColor];
label.backgroundColor = [UIColor blueColor];
//1.5 自动换行
label.numberOfLines = 0;
//1.6 对齐方式
label.textAlignment = NSTextAlignmentRight;
//1.7 设置字体大小 (默认的 system格式 加粗 和斜体三种字体模式)
label.font = [UIFont boldSystemFontOfSize:30.f];
//2.0 把 Label 显示到 view上
[self.view addSubview:label];
}
@end