• UILabel 用法


     UILabel:

    - (void)viewDidLoad

    {

        [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

        NSString *str=@"i am a string";

        

        UIFont *_font=[UIFont fontWithName:@"Arial" size:50.0f];

        

        CGSize labesize=[str sizeWithFont:_font];

        

        UILabel *_label=[[UILabel alloc]init];

        _label.text=str;

        _label.font=_font;

        _label.frame=CGRectMake(0, 0, labesize.width, labesize.height);

        

        [self.view addSubview:_label];

        [_label release];


    }


    run result: 

  • 相关阅读:
    微博Feed流
    朋友圈
    Go命令行—compile
    Practical Go: Real world advice for writing maintainable Go programs
    Nginx Cache-Control
    Redis 主从复制
    JAVA
    Tomcat
    Tomcat
    CentOS 7
  • 原文地址:https://www.cnblogs.com/csj007523/p/2576243.html
Copyright © 2020-2023  润新知