rendering error; couldn't resolve @id/search_edit_frame

此生再无相见时 提交于 2019-12-22 04:12:12

问题


I am having an error that says couldn't resolve @id/search_edit_frame I don't know why, I tried the File>Invalidate Caches> Just Restart and restart android studio also tried to change the render version all of my supported api..

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   myapp="http://schemas.android.com/apk/res-auto"
   android:layout_width="match_parent"
   android:layout_height="match_parent">
   <android.support.v7.widget.SearchView
      android:id="@+id/svSearch"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textSize="25sp"
      android:textColor="@color/textDefault"
       myapp="@string/search_hint"
       myapp="false" />
</LinearLayout>

I'm using Android Studio 1.2.2 and sure that it compiles android.support.v7.widget(AppCompat)

any help will be appreciated.. thanks


回答1:


Use

 <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" />

it should work




回答2:


First, you can search @id/search_edit_frame in all your xml file to check where it comes from.

Second, if you are sure that there is no @id/search_edit_frame in your xml, then you can try to delete all files in your Build folder.

Try to clean your project also.



来源:https://stackoverflow.com/questions/31467412/rendering-error-couldnt-resolve-id-search-edit-frame

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