rendering error; couldn't resolve @id/search_e

2019-04-20 18:46发布

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

2条回答
啃猪蹄的小仙女
2楼-- · 2019-04-20 19:26

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.

查看更多
相关推荐>>
3楼-- · 2019-04-20 19:35

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

查看更多
登录 后发表回答