呈现问题无法解析资源@ id/search_edit_frame [英] Rendering Problems Couldn't resolve resource @id/search_edit_frame

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

问题描述

渲染问题无法解决资源@ id/search_edit_frame

Rendering Problems Couldn't resolve resource @id/search_edit_frame

这是我在xml文件中遇到的呈现错误.我认为与support.v7.SearchView有关的是我的xml:

This is the rendering error I'm getting in my xml file. I think it has something to do with my support.v7.SearchView below is my xml:

 <RelativeLayout
    android:id="@+id/layout_ricerca"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="@drawable/search_border_backgroud"
    android:layout_marginStart="10dp"
    android:layout_marginEnd="10dp"
    android:layout_marginTop="20dp">

    <android.support.v7.widget.SearchView
        android:id="@+id/testo_ricerca"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:queryHint="@string/search_hint"
        android:textSize="25sp"
        android:layout_marginStart="5dp"
        android:iconifiedByDefault="false"/>

    <ImageButton
        android:id="@+id/tasto_ricerca"
        android:background="@color/trans"
        android:layout_marginTop="2dp"
        android:layout_width="45dp"
        android:layout_height="match_parent"
        android:layout_marginEnd="3dp"
        android:scaleType="centerInside"
        android:layout_alignParentEnd="true"
        android:src="@drawable/tasto_ricerca"/>
</RelativeLayout>

当我将<android.support.v7.widget.SearchView更改为<SearchView时,错误消失了,但这对我来说不是一个好的解决方案,因为我必须更改所有Java代码才能使用SearchView而不是android.support.v7.widget.SearchView.

When I change the <android.support.v7.widget.SearchView to <SearchView the error disappears, but that's not a good solution for me because I would have to change all my java code to work with the SearchView instead of the android.support.v7.widget.SearchView.

有人知道如何解决此问题吗?为什么会发生?我认为我的xml没什么问题.

Does anyone know how to fix this problem ? why does it happen? I don't think there is anything wrong with my xml.

添加了错误的屏幕截图

推荐答案

当您将大量缓存数据存储在Android Studio中时,这种类型的错误就要来了.

When you have lot of cache memory data are store in Android Studio that time this type of error is coming..

有很多解决方法.

  1. 最快的方法是FileInvalidate caches / Restart...Just Restart.

右键单击projectSynchronize ...Project

这篇关于呈现问题无法解析资源@ id/search_edit_frame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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