1
私はguidelines for contributing of Cosmic Mind Material library for iOSを読んだことがあります。私は色合いの色やTextFieldのカーソルを変更することはできません。ComicMind材質TextField色合いが変わらない
func setupCustomTextField(textColor: UIColor, placeHolder: String?, delegate: UITextFieldDelegate) -> TextField? {
guard let materialSelf = self as? TextField else {
return nil
}
materialSelf.backgroundColor = .clear
materialSelf.textColor = textColor
materialSelf.borderColor = textColor
materialSelf.isClearIconButtonEnabled = true
materialSelf.delegate = delegate
materialSelf.dividerNormalColor = textColor
materialSelf.dividerActiveColor = textColor
materialSelf.tintColor = textColor
materialSelf.font = R.font.latoRegular(size: 15)
if let placeHolder = placeHolder {
let localizedPlaceHolder = NSLocalizedString(placeHolder, comment: "")
let attributedString = NSAttributedString(string: localizedPlaceHolder,
attributes: [NSForegroundColorAttributeName: textColor])
materialSelf.attributedPlaceholder = attributedString
}
return materialSelf
}