使用 TextInputLayout 时无法解析资源 @id/visible [英] Couldn't resolve resource @id/visible when using TextInputLayout
本文介绍了使用 TextInputLayout 时无法解析资源 @id/visible的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 appcompat-v7:25.x.x
尝试了以下步骤,但问题仍然存在:
Tried these steps below, but the problem is still persist:
- 重建项目
- 清理并重建项目
- 清除缓存和重启 Android Studio
下面是布局文件中的代码.
Below is the code in the layout file.
<android.support.design.widget.TextInputLayout
android:id="@+id/tilFirstName"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/etFirstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/first_name"
android:inputType="textPersonName"/>
</android.support.design.widget.TextInputLayout>
以下是 Android Studio 中显示的消息
Below is the message displayed in Android Studio
渲染问题.
无法解析资源@id/visible
提示:尝试刷新布局.
注意:@id/visible
不在代码中.
推荐答案
这与渲染问题"窗口有关
This nags one with the Rendering Problems window
如何解决:将这些值添加到任何值文件(文件名似乎无关紧要,我使用 ids.xml
,您也可以使用现有的,例如 colors.xml
或 strings.xml
)
How to fix: add these values to any values file (the filename doesn't appear to matter, I use ids.xml
, you can use an existing one as well, such as colors.xml
or strings.xml
)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="visible" type="id"/>
<item name="masked" type="id"/>
</resources>
这篇关于使用 TextInputLayout 时无法解析资源 @id/visible的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文