首页 > 解决方案 > TextInputEditText 没有“setStartIconDrawable”功能,为什么?

问题描述

我正在玩TextInputEditTextand TextInputLayout,尝试功能和材料设计。

我有

implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'

在毕业典礼上,

在代码中:

    //Cannot resolve method 'setStartIconDrawable(int)
    textInputLayout.setStartIconDrawable(R.drawable.ic_close);

事实上,“我的”TextInputLayout 还缺少很多其他功能。

这到底是什么?

我已经检查过材料库中没有更新版本,只有 alpha 版本。

标签: androidandroid-textinputlayout

解决方案


implementation 'com.google.android.material:material:1.1.0-alpha06'

这是工作。

奇怪的是,您被迫使用 alpha 版本来使用指南中的功能......


推荐阅读