TabLayout cannot be resolved to a type- Eclipse

末鹿安然 提交于 2019-12-11 00:58:02

问题


I want to create a TabLayout with ViewPager. I'm using api version 22. I'm getting this error

TabLayout cannot be resolved to a type

I'm using Eclipse for development.


回答1:


You were remaining with adding support library in your project.

Before use the design support library, you have to import support-v7-appcompat library from android-sdks\extras\android\support\v7\appcompat. Then, you have to:

  • create an android library project in eclipse for design support library
  • put the contents of directory android-sdks\extras\android\support\design in the design support library project
  • Link appcompat-v7 library to design support library project
  • Link support library project from your project.

You can not use directly the jar android-support-design.jar because you need some resources too (this is the reason of aar format).

For more info just check Error in styles_base.xml file - android app - No resource found that matches the given name 'android:Widget.Material.ActionButton'



来源:https://stackoverflow.com/questions/35456147/tablayout-cannot-be-resolved-to-a-type-eclipse

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