我正在尝试设置这样的按钮属性, 当我添加此代码时,它崩溃了,甚至没有显示我在 main.storyboard 中的按钮。
let containerScheme = MDCContainerScheme()
cancelButton.applyOutlinedTheme(withScheme: containerScheme)
最佳答案
我遇到了同样的问题。但我是通过代码构建 UI 的。
import MaterialComponents.MaterialButtons
import MaterialComponents.MaterialButtons_Theming
let button = MDCButton()
button.applyTextTheme(withScheme: MDCContainerScheme())
以下内容对我有帮助。我刚刚调用了选项产品 -> 清理构建文件夹
。
之后程序异常终止的现象消失了。
关于ios - MDC 崩溃并显示 'NSInvalidArgumentException' ,原因 : '-[UIButton applyOutlinedThemeWithScheme:]: unrecognized selector sent to instance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56519071/