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];
       
     
  • 相关阅读:
    EntytyFramework批量更新
    EntityFramework批量Insert
    asp.net MVC Session锁的问题
    谈谈ThreadStatic
    C#中XmlSerializer的内存占用问题
    转:【译】Asp.net MVC 利用自定义RouteHandler来防止图片盗链
    面试心得
    Part 39 AngularJS route change events
    Part 38 AngularJS cancel route change
    Part 37 Difference between $scope and $rootScope
  • 原文地址:https://www.cnblogs.com/iQingYang/p/6687610.html
Copyright © 2011-2022 走看看