Rendering Problems Couldn't resolve resource @id/search_edit_frame

大憨熊 提交于 2019-12-04 02:27:58

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

There are many way to solve it.

  1. Quickest way to do that is FileInvalidate caches / Restart...Just Restart.

  2. Right click on project and Synchronize ...Project

  3. click on Build menu --> select Clean Project and then Rebuild it.

To resolve this issue, provide an

android:id="@+id/search_edit_frame"

attribute to a parent view such as

android.support.design.widget.AppBarLayout

or any ViewGroup that is parent to your SearchView.

For example:

<android.support.design.widget.AppBarLayout
  android:id="@+id/search_edit_frame"
  android:layout_width="match_parent"
  android:layout_height="@dimen/my_app_bar_height">

  <android.support.v7.widget.SearchView
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<android.support.design.widget.AppBarLayout />

use this code

<SearchView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/searchView"
android:iconifiedByDefault="true"
android:queryHint="Search"
android:layout_centerHorizontal="true" />
    android:id="@+id/search_edit_frame"

add above line to parent layout that did the trick for me

Here is an easy one solution.

There is no need of invalidating cache Or restarting. Just add below line into your strings.xml file and problem will get solved.

 <item name="search_edit_frame" type="id"/>

Bingo!

I have the same problem but in eclipse IDE and I solved it by 1- click on project --> clean and it solved the problem with me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!