使用TextInputLayout时无法解析资源@ id/visible [英] Couldn't resolve resource @id/visible when using TextInputLayout
问题描述
在appcompat-v7:25.x.x
上使用TextInputLayout
时无法解析资源@id/visible
尝试了以下步骤,但问题仍然存在:
- 重建项目
- 清理并重建项目
- 清除缓存和 重新启动Android Studio
下面是布局文件中的代码.
<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中显示的消息
渲染问题.
无法解析资源
@id/visible
提示:尝试刷新布局.
注意:代码中不存在@id/visible
.
这与渲染问题"窗口令人na目结舌
如何解决:将这些值添加到任何值文件中(文件名似乎无关紧要,我使用ids.xml
,也可以使用现有的文件名,例如colors.xml
或strings.xml
)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="visible" type="id"/>
<item name="masked" type="id"/>
</resources>
Couldn't resolve resource @id/visible
when using TextInputLayout
on appcompat-v7:25.x.x
Tried these steps below, but the problem is still persist:
- Rebuild Project
- Clean and Rebuild Project
- Clear Cache and Restart 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>
Below is the message displayed in Android Studio
Rendering Problems.
Couldn't resolve resource
@id/visible
Tip: Try to refresh the layout.
NOTE: @id/visible
is not present in the code.
This nags one with the Rendering Problems window
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屋!