使用TextInputLayout时无法解析资源@ id/visible [英] Couldn't resolve resource @id/visible when using TextInputLayout

查看:77
本文介绍了使用TextInputLayout时无法解析资源@ id/visible的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

appcompat-v7:25.x.x上使用TextInputLayout时无法解析资源@id/visible

尝试了以下步骤,但问题仍然存在:

  1. 重建项目
  2. 清理并重建项目
  3. 清除缓存和 重新启动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.xmlstrings.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:

  1. Rebuild Project
  2. Clean and Rebuild Project
  3. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆