zoukankan      html  css  js  c++  java
  • UI<05>

    //声明UILabel对象
    @property (nonatomic,strong) UILabel *label;
     // 初始化
        self.label = [[UILabel alloc] init];
        self.label.backgroundColor = [UIColor clearColor];
       
        //设置frame
        self.label.frame = CGRectMake((self.view.frame.size.width-80)/2.0,80, 80, 100);
       
        //设置文本内容
        self.label.text = @"In the evening one may praise the day.";
        //设置字体大小
        self.label.font = [UIFont systemFontOfSize:17.0];
        //设置字体颜色
        self.label.textColor = [UIColor blueColor];
        //设置阴影偏移量
        //self.label.shadowOffset = CGSizeMake(1.0, 0.5);
        //设置阴影颜色
        //self.label.shadowColor = [UIColor purpleColor];
        //设置文本对其方式
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.lineBreakMode = NSLineBreakByTruncatingMiddle;
        //设置行数 默认1 0代表自动换行
        //self.label.numberOfLines = 0;
       
        //设置自适应宽度
        //self.label.adjustsFontSizeToFitWidth = YES;
        //设置能否与用户交互
        self.label.userInteractionEnabled = YES;
        //设置文本是否可变
        self.label.enabled = YES;
        //设置文本是否高亮显示
        //self.label.highlighted = YES;
        //设置文本高亮显示颜色
        //self.label.highlightedTextColor = [UIColor redColor];
       

       
        [self.view addSubview:self.label];
       
     
  • 相关阅读:
    37.1 net-- udp传输
    37 net 网络编程
    review
    java day02 记录
    36.2 线程生命周期
    36.1 线程锁
    36 Thread 多线程
    35 编码 ASCII Unicode UTF-8 ,字符串的编码、io流的编码
    34.6 Properties(k,v存储) 和io流结合使用
    今日学习总结
  • 原文地址:https://www.cnblogs.com/iQingYang/p/6687610.html
Copyright © 2011-2022 走看看