Rendering problems, could not find android.support.v4.widget.Drawerlayout

a 夏天 提交于 2019-12-11 12:49:23

问题


I have tried each and every solution from the SO, but my problem still isn't solved. Following is the error I am getting:

The following classes could not be found: - android.support.v4.widget.DrawerLayout (Fix Build Path, Create Class) Tip: Try to build the project.

I am just exporting this android project into android studio(1.2). I have applied this solution and many other , but with no success.


回答1:


Android Studio's XML editor preview will give you that error whenever you use a "custom" view - be it third-party library views or Google's own DrawerLayout, as you've experienced yourself.

But fear not, that error will only be shown on the XML preview, your project should compile just fine. Go ahead and try. :)

Hope this helped!

p.s., Switching API level on the editor (as suggested by an answer here) helps fix API 22 rendering error for "normal" in-build views, but not for DrawerLayout or any other third-party views really.




回答2:


You Need To change the API level from 5.1.1 to 5.0.1.it is on upper right side corner in design of xml.:)



来源:https://stackoverflow.com/questions/30882191/rendering-problems-could-not-find-android-support-v4-widget-drawerlayout

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