Swift UILabel方法總結

        let label = UILabel();
        label.frame = CGRect(x:100,y:100,width:160,height:30);
        label.text = "我是SwiftLabel";
        label.backgroundColor = UIColor.orange;
        label.textColor = UIColor.blue;
        label.font = UIFont.systemFont(ofSize: 22);
        label.textAlignment = NSTextAlignment.center
        label.isUserInteractionEnabled = true;
        self.view?.addSubview(label);

io

相關文章
相關標籤/搜索