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

直接运行swift demo报错,因为没有设置textView的字体样式,崩溃日志如下,还有,键盘输入时,最大行数限制有效,选择键盘上的候选文本,行数限制无效 #2

Open
jkwf opened this issue Nov 22, 2019 · 12 comments

Comments

@jkwf
Copy link

jkwf commented Nov 22, 2019

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/kangfang/Downloads/YLTextView-master/YLTextViewDemo/YLTextView_SwitDemo/YLTextView_Swit/YLTextView/YLTextView-Extension.swift, line 217
Simulator Screen Shot - iPhone 8 Plus - 2019-11-22 at 11 16 33

@Rain-dew
Copy link
Owner

Rain-dew commented Nov 22, 2019 via email

@Rain-dew
Copy link
Owner

Rain-dew commented Dec 18, 2019 via email

@Rain-dew
Copy link
Owner

Rain-dew commented Dec 18, 2019 via email

@jkwf
Copy link
Author

jkwf commented Dec 19, 2019

Xcode版本: 11.3
编译swift demo,修改如图代码,运行闪退
截屏2019-12-1916 32 48

崩溃位置
截屏2019-12-1916 36 39

建议该方法做以下调整:
截屏2019-12-1916 40 03

@Rain-dew
Copy link
Owner

Rain-dew commented Dec 19, 2019 via email

@Rain-dew
Copy link
Owner

Rain-dew commented Dec 19, 2019 via email

@jkwf
Copy link
Author

jkwf commented Dec 19, 2019

对,获取的font是nil, 模拟器版本是13.3

@Rain-dew
Copy link
Owner

Rain-dew commented Dec 19, 2019 via email

@jkwf
Copy link
Author

jkwf commented Dec 19, 2019

更新最新的也是有问题,建议增加默认font,还有发现一个问题
override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .lightGray let textview = UITextView(frame: CGRect(x: 100, y: 100, width: 200, height: 20)) textview.placeholder = "喜欢请Star" textview.limitLines = 4; textview.autoHeight = true textview.center = self.view.center view.addSubview(textview) }
这样写,选择输入中文,第一次输入中文确定后,就输不了中文,不加这一句代码《textview.placeholder = "喜欢请Star"》会闪退

@Rain-dew
Copy link
Owner

Rain-dew commented Dec 19, 2019 via email

@jkwf
Copy link
Author

jkwf commented Dec 19, 2019

嗯,你更新一下最新版的看一下

@Rain-dew
Copy link
Owner

Rain-dew commented Dec 19, 2019 via email

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

2 participants