swift的UIlabel

 let label = UILabel(frame:CGRect(x:0,y:0,width:150,height:200));
        
        label.text="i am a  am a label am a label am a labellabel";
        label.font = UIFont.boldSystemFont(ofSize: 20)
        label.font = UIFont.systemFont(ofSize: 20)
        label.textColor=UIColor.cyan
        label.backgroundColor=UIColor.blue
        label.textAlignment=NSTextAlignment.center
        
        label.shadowColor=UIColor.orange
        
        //设置label行数 ,0表示无限行,(不超过label的宽高)
        label.numberOfLines=0
        self.view.addSubview(label)

 

posted @ 2018-02-22 21:04  layfork  阅读(147)  评论(0编辑  收藏  举报