Swift UITextField經常使用方法

        let textfiled = UITextField();
        textfiled.frame = CGRect.init(x:100,y:250,width:160,height:30);
        textfiled.borderStyle = UITextBorderStyle.roundedRect;
        textfiled.placeholder = "請輸入用戶名";
        textfiled.adjustsFontSizeToFitWidth = true;
        textfiled.minimumFontSize = 1;
        textfiled.textAlignment = .right;
        textfiled.contentVerticalAlignment = .bottom;
        textfiled.borderStyle = .none;
        textfiled.background = UIImage(named:"");
        self.view.addSubview(textfiled);it

相關文章
相關標籤/搜索