TabLayout cannot be resolved to a type- Eclipse

2019-07-18 03:07发布

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.

SDK manager

1条回答
Viruses.
2楼-- · 2019-07-18 03:49

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'

查看更多
登录 后发表回答