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];
       
     
  • 相关阅读:
    Nginx 配置文件
    Nginx 目录结构
    Nginx 功能模块
    logrotate日志管理工具
    Nginx 编译安装
    CentOS7安装Tomcat
    springcloud如何实现服务的平滑发布
    springcloud zuul聚合微服务的swagger文档
    alibaba的springcloud孵化器项目
    springcloud灰度发布实现方案
  • 原文地址:https://www.cnblogs.com/iQingYang/p/6687610.html
Copyright © 2011-2022 走看看