【问题标题】:Material edit text not rendering in android studio editor材料编辑文本未在 android studio 编辑器中呈现
【发布时间】:2020-05-13 05:07:23
【问题描述】:

我的 android sudio 设计编辑器不渲染材质 TextInputLayouts。我已经尝试过使缓存无效。其他所有元素都在渲染正确的其他材质元素

                   <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/ti"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="20dp"
                    android:layout_marginEnd="30dp"
                    android:layout_marginBottom="20dp"
                    android:hint="@string/street_number">

                    <com.google.android.material.textfield.TextInputEditText
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:inputType="text"
                        android:text="@{vm.user.streetnumber}" />
                </com.google.android.material.textfield.TextInputLayout>

【问题讨论】:

    标签: android android-studio android-edittext material-design android-textinputlayout


    【解决方案1】:

    你必须在 build.gradle 中改变

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

    似乎较新的版本没有正确呈现。

    见:how to solve render problem Path.op() not supported?

    【讨论】:

    • 我使用的是1.2.0-alpha05 版本,但渲染效果不佳。谢谢
    【解决方案2】:

    您需要在布局构建器中更改主题以匹配您的应用。

    【讨论】:

    • 不起作用,默认为 Material.Light.NoActionBar。尽管如此,我也尝试了其他主题,仍然是同样的错误。
    【解决方案3】:

    在我的情况下更新 Android Studio,问题修复

    【讨论】:

      【解决方案4】:

      在 XML 中显示所有警告,然后按以蓝色包裹的建议,然后按现代渲染功能并重新启动 Android Studio。您可以关闭此功能。

      【讨论】:

        猜你喜欢
        • 2020-08-15
        • 2020-11-09
        • 2016-09-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-12-30
        相关资源
        最近更新 更多