Tul*_*leb 8 ios swift material-components ios13
我无法再在iOS 13上使用该rightView属性MDCTextField。我是唯一对此有疑问的人吗?
正确的视图宽度覆盖整个文本字段:防止用户交互并隐藏textView内容。
从切换MDCTextField到时没问题UITextField。
Moj*_*ini 12
Add width constraint to the rightView/leftView.
Don't forget to set translatesAutoresizingMaskIntoConstraints = false
rightView.translatesAutoresizingMaskIntoConstraints = false
rightView.widthAnchor.constraint(equalToConstant: <#NeededWidth#>).isActive = true
// This is enough to make it act like before but you can set other missing constraints like height to suppress layout warnings and prevent further issues.
// rightView.widthAnchor.constraint(equalToConstant: <#HeightOfTheTextField#>).isActive = true
Run Code Online (Sandbox Code Playgroud)
You may notice some autolayout warnings in the consule because you didn't set the missing constraint for the rightView/leftView. So add missing constraints or simply ignore those.
And note that if the rightView/leftView is some kind of StackView, try to putting it inside a view and then add this view instead.
| 归档时间: |
|
| 查看次数: |
675 次 |
| 最近记录: |