SearchView on support.v7.appcompat library issue: default 9-patch background not renders properly

后端 未结 3 495
面向向阳花
面向向阳花 2021-01-17 15:33

I\'m developing an app with ActionBar using support.v7.appcompat library. The action bar works, the SearchView is shown, the hint shows. The only problem is that the backgro

相关标签:
3条回答
  • 2021-01-17 15:38

    I had the same issue with build tools 19.0.1, but newer version 19.0.3 fixed the problem. Try it, hopefully it will help you too.

    0 讨论(0)
  • 2021-01-17 15:45

    Ok, I want to kill myself. I've fixed it. Don't know how. I can't reproduce the bug again!

    what I think has fixed the bug: I've added import android.support.v7.app.ActionBar;

    Then I've removed it to reproduce the bug, but it's not back.

    I also did uninstall Build-tools 18.0.1 (which is in italics and made me suspicious), so I thought it might be the source of the bug. But I've reinstalled it, and can't reproduce the bug either.

    I don't know what else could possibly be. Anyway, moving on... (sight)

    Edit:

    It happened again, and this time I've been able to narrow it down. Turns out it is a bug of Build Tools v18.*, downgrading to v17 solves the issue.

    0 讨论(0)
  • 2021-01-17 15:45

    This is usually an issue where the resources (R) file has not been correctly generated and some references are misaligned.

    Doing a clean is usually a good fix, as it regenerates this file. This is what you inadvertently did when reinstalling.

    0 讨论(0)
提交回复
热议问题