zoukankan      html  css  js  c++  java
  • swift Lable

    import UIKit

     

    class LableViewController: BaseViewController {

      

        override func viewDidLoad() {

            super.viewDidLoad()

     

            let bodyFontDescriptor = UIFontDescriptor.preferredFontDescriptorWithTextStyle(UIFontTextStyleBody)

            let label:UILabel = UILabel(frame: CGRectMake(50, 100, 200, 100))

            label.backgroundColor = UIColor.blackColor()

            label.textAlignment = NSTextAlignment.Center

            label.textColor = UIColor.whiteColor()

            label.text = "我是一个Label控件我是一个Label控件我是一个Label控件我是一个Label控件我是一个Label控件"

            label.numberOfLines = 0

            label.font = UIFont(descriptor: bodyFontDescriptor, size: 15)

    //        sizeLabel.font = UIFont.systemFontOfSize(15)  

    //        sizeLabel.font = UIFont.boldSystemFontOfSize(15)

            self.view.addSubview(label)

     

            

        }

        

        override func didReceiveMemoryWarning() {

            super.didReceiveMemoryWarning()

            // Dispose of any resources that can be recreated.

        }

       

    }

     

    /*

     

    1.整个文件的结构是怎样的

    整个文件被一对 花括号 包起来, override func viewDidLoad() 加载子视图,各种控件

    2.声明的函数、方法写在什么地方

    oc对比,下载 最大花括号里面即可 

    3.override  重写父类方法 

    4.BaseViewController  是工程中创建的父控制器 (可以写一些公共控件、方法、属性等)

    5.func  方法声明 

     

     

    */

     

     

     

  • 相关阅读:
    如何配置透明发光的骚气 vscode —— Jinkey 原创
    JS引用类型总结
    element UI -- 默认样式修改不成功原因
    上传本地Vue项目到github
    网页加载速度优化方法总结
    移动端click时间、touch事件、tap事件详解
    移动端开发用touch事件还是click事件
    禁止网站调用favicon.ico请求
    HTTP里面的响应和请求
    jave script 中this的指向 (六种场景)
  • 原文地址:https://www.cnblogs.com/madaha/p/4141116.html
Copyright © 2011-2022 走看看