Material 编辑文本未在 android 工作室编辑器中呈现
Material edit text not rendering in android studio editor
我的 android sudio 设计编辑器不呈现 material TextInputLayouts。我已经尝试过使缓存无效。其他每个元素都正确渲染其他 material 个元素
<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>
您需要更改布局生成器中的主题以匹配您的应用。
您必须在 build.gradle
中更改
implementation 'com.google.android.material:material:1.2.0-alpha02'
似乎较新的版本没有正确呈现。
参见:
在我的情况下更新 Android Studio,问题修复
显示 XML 中的所有警告,然后按到用蓝色包裹的建议,然后按现代渲染功能并重新启动 Android Studio。您可以关闭此功能。
我的 android sudio 设计编辑器不呈现 material TextInputLayouts。我已经尝试过使缓存无效。其他每个元素都正确渲染其他 material 个元素
<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>
您需要更改布局生成器中的主题以匹配您的应用。
您必须在 build.gradle
中更改implementation 'com.google.android.material:material:1.2.0-alpha02'
似乎较新的版本没有正确呈现。
参见:
在我的情况下更新 Android Studio,问题修复
显示 XML 中的所有警告,然后按到用蓝色包裹的建议,然后按现代渲染功能并重新启动 Android Studio。您可以关闭此功能。