答案 0 :(得分:3)
要获得大致的外观,您要做的就是对您的TextInputLayout
标签应用“大纲”样式:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
...>
<com.google.android.material.textfield.TextInputEditText
.../>
</com.google.android.material.textfield.TextInputLayout
跳到顶部的“电子邮件或电话”文本是在布局上设置的“提示”文本。
<com.google.android.material.textfield.TextInputLayout
android:hint="Email or phone"
...>
TextInputLayout开发人员指南:https://material.io/develop/android/components/text-input-layout/
您将在应用程序中需要Google Material Components库。入门指南:https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md