材质TextInputLayout样式不起作用 [英] Material TextInputLayout styles are not working

查看:78
本文介绍了材质TextInputLayout样式不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TextInputLayout的样式无效.

我在这里遵循了有关材料textinputlayout的文档:

解决方案

似乎在预览中不起作用,我必须在设备上运行它才能看到真实的输出.感谢@NileshRathod

我希望android可以解决此问题

Material TextInputLayout styles are not working.

I followed the documentation on material textinputlayout here: https://material.io/develop/android/components/text-input-layout/

<com.google.android.material.textfield.TextInputLayout
    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    android:layout_marginEnd="8dp"
    android:hint="@string/app_name"
    app:boxStrokeColor="@android:color/white"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <com.google.android.material.textfield.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</com.google.android.material.textfield.TextInputLayout>

With gradle:

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

Using the style OutlinedBox, I expect to have the layout to have an outline but instead it just shows a plain TextInputLayout.

解决方案

It seems that it's not working on preview, I had to run it on a device to see the real output. Thanks to @NileshRathod

I hope that android fixes this

这篇关于材质TextInputLayout样式不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆