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];
       
     
       
    }
  • 相关阅读:
    SQL SELECT DISTINCT 语句
    SQL SELECT 语句
    SQL 语法
    Linux 命令大全
    MySQL 安装
    Nginx 安装配置
    linux yum 命令
    Linux 磁盘管理
    Linux 文件与目录管理
    Linux 用户和用户组管理
  • 原文地址:https://www.cnblogs.com/guiyangxueyuan/p/5255583.html
Copyright © 2011-2022 走看看