Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

删除单词末尾最后一个字符,键盘默认变成大写输入 #943

Open
JonathanChen123 opened this issue Dec 28, 2020 · 0 comments

Comments

@JonathanChen123
Copy link

JonathanChen123 commented Dec 28, 2020

删除单词末尾最后一个字符,键盘默认变成大写输入。

比如输入“Hello thr”,删除最后一个r时,键盘会自动切换到大写输入。

iPhoneX iOS14.2

public lazy var textView: YYTextView = {
    
    let textView = YYTextView()
    
    var placeholder = "Comment"
    
    let infoString = UserDefaults.LoginInfo.value(forKey: .userInfo) as? String
    
    if let data = infoString?.data(using: .utf8) {
        if let info = try? JSON(data: data) {
            if let nick_name = info["nick_name"].string {
                placeholder = placeholder + " as " + nick_name
            }
        }
    }
    
    textView.tintColor = TSApprearance.Colors.theme
    textView.textAlignment = .left
    textView.placeholderAttributedText = NSMutableAttributedString(string: placeholder, attributes: [NSAttributedString.Key.font: UIFont.avenirRoman(size: 12.0), NSAttributedString.Key.foregroundColor: UIColor(65.0, 65.0, 65.0, 0.4)])
    textView.font = .avenirRoman(size: 12.0)
    textView.textContainerInset = UIEdgeInsets(top: 13.0, left: -3.0, bottom: 13.0, right: -3.0)
    textView.textColor = TSApprearance.Colors.Text.black
    textView.allowsCopyAttributedString = false

    
    return textView
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant