【发布时间】:2020-02-04 05:05:44
【问题描述】:
【问题讨论】:
标签: android android-textinputlayout material-components-android material-components
【问题讨论】:
标签: android android-textinputlayout material-components-android material-components
使用TextInputLayout 和app:startIconDrawable
<com.google.android.material.textfield.TextInputLayout
android:hint="Select Time"
app:startIconDrawable="@drawable/ic_add_24px"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
../>
</com.google.android.material.textfield.TextInputLayout>
注意:它需要 1.1.0 版本的库。
【讨论】:
app:startIconDrawable 属性对我不起作用。该图标未显示在设计视图中,并且出现如下错误:AAPT: error: attribute app:startIconDrawable not found. 除此之外,材质组件库似乎工作正常。
1.0.0。更新为1.2.0-alpha01,但现在我失去了整个材质风格。我只能看到布局设计上的默认 AppCompat 样式。