在@id/visible上使用TextInputLayout时无法解析资源appcompat-v7:25.x.x
尝试了以下步骤,但问题仍然存在:
下面是布局文件中的代码。
<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中显示的消息
渲染问题。 无法解析资源
@id/visible提示:尝试刷新布局。
注意:代码中不存在@id/visible。
发布于 2017-02-06 23:52:44
这会使呈现问题窗口出现问题。
如何修复:将这些值添加到任何值文件(文件名似乎并不重要,我使用的是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>发布于 2016-12-28 06:08:31
它很可能是一个bug,而且一直是在问题追踪器中存档。
同时,您可以尝试通过您可能会看到设计输出中的一些细微差别。将编辑器中的API版本切换到19或更低版本。
发布于 2017-02-06 10:45:04
不需要更改API
无法解析资源@string/faq_customer_service
或
无法解析资源@id/visible
或
无法解析资源@id/masked
解决方案是,如果您实现TextInputLayout,可能会出现上述问题.因此,只需将这些id或字符串添加到xml文件中作为它们的属性。
https://stackoverflow.com/questions/41303347
复制相似问题