UI基础学习第一天


//创建并初始化window,给定屏幕大小
self.window = [UIWindow alloc]initWithFrame:[[UIScreen mainScreen].bounds]

//设置背景颜色
self.window setBackgroundColor: [UIColorcolorWithRed:243/255.0green:208/255.0blue:56/255.0alpha:1]]

//作为主window并且显示
[self.windowmakeKeyAndVisible];

//设置根视图控制器
[self.windowsetRootViewController:[UIViewControllernew]];



//将某一个子视图放到最后面
    [self.window sendSubviewToBack:view2];
//    //将一个子视图移到最前面
    [self.window bringSubviewToFront:view1];
//    //交换视图
//    [self.window exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
//    //从父视图移除
    [view2 removeFromSuperview];




//中心点
    View.center = CGPointMake(self.window.frame.size.width/2, self.window.frame.size.height/2);
   //控制视图显隐
    View.hidden =NO;//(是否隐藏)
    //控制视图透明度
    View.alpha = 1;//(0-1之间)
    //标签
    View.tag = 101;  //用来做标记的
    //获取父视图(获取的是视图(强转))
    UIWindow *window = (UIWindow *)View.superview;
    //获取子视图(用数组)
    NSArray *array = View.subviews;





//    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 100)];
//    label.center = CGPointMake(self.window.bounds.size.width/2, self.window.bounds.size.height/2);
//    //设置label的颜色
//    label.backgroundColor = [UIColor whiteColor];
//    //设置label文本
//    label.text = @"人生若只如初见,何事秋风悲画扇,等闲变却故人心,却道故人心易变.";
//    //文本对齐方式
//    label.textAlignment = NSTextAlignmentCenter;
//    //文本颜色
//    label.textColor = [UIColor magentaColor];
//    //文本字体大小
    label.font = [UIFont fontWithName:@"" size:22.0];
//    label.font = [UIFont systemFontOfSize:25];
//    //文本阴影
//    label.shadowOffset = CGSizeMake(2, -2);//偏移量
//    label.shadowColor = [UIColor cyanColor];//阴影颜色
//    //文本边框
//    label.layer.borderWidth = 3;//边框宽度
//    label.layer.borderColor = [UIColor redColor].CGColor;//边框颜色
//    //文本圆角
//    label.layer.cornerRadius = 10;//内切圆半径
//    label.layer.masksToBounds = YES;//切除多余部分
//    //设置文本行数
//    label.numberOfLines= 4;
//    //文本换行模式
//    label.lineBreakMode= NSLineBreakByWordWrapping;
//    //添加到父视图
//    [self.window addSubview:label];

   //旋转
//    sh.transform = CGAffineTransformMakeRotation(M_PI);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值