zoukankan      html  css  js  c++  java
  • 浅谈UI—视图的文本编辑方法

    ViewController.h。。。。。。。。。。
     
    @interface ViewController : UIViewController

    @property(strong,nonatomic)UILabel *label;
     
    @end
     
     
    ViewController.m。。。。。。。。。。。
     
    @interface ViewController ()

    @end

    @implementation ViewController

    - (void)viewDidLoad {
        [super viewDidLoad];
        UILabel *labelName=[[UILabel alloc]initWithFrame:CGRectMake(100, 100, 30, 550)];
        labelName.backgroundColor=[UIColor greenColor];
        //添加文本
        labelName.text=@"姓名:htdhrsrhyrreywrw6twgwre524w";
        //文本颜色
        labelName.textColor=[UIColor redColor];
        //文本对齐方式
        labelName.textAlignment=NSTextAlignmentCenter;//(left、right)
        //文本字号
        labelName.font=[UIFont systemFontOfSize:20];
        //文本行数
        labelName.numberOfLines=5;
        [self.view addSubview:labelName];
       
     
       
    }
  • 相关阅读:
    RabbitMq+Haproxy负载均衡
    RabbitMq常用命令
    几种常见的消息队列
    RabbitMq集群搭建
    a=a+b与a+=b的区别
    Redis集群搭建
    变量作用域
    8.3吝啬SAT问题
    Surrounded Regions
    Binary Tree Maximum Path Sum
  • 原文地址:https://www.cnblogs.com/guiyangxueyuan/p/5255583.html
Copyright © 2011-2022 走看看